MCPcopy
hub / github.com/webpack/webpack / itIfAvailable

Function itIfAvailable

test/configCases/node/output-module-external/require.js:74–82  ·  view source on GitHub ↗
(imported)

Source from the content-addressed store, hash-verified

72const fsPromises = NODE_VERSION >= 14 ? require("fs/promises") : undefined;
73
74const itIfAvailable = (imported) =>
75 imported
76 ? (desc, fn) =>
77 it(desc, () => {
78 fn(imported);
79 })
80 : () => {
81 // skip
82 };
83
84it("should assert equality", () => {
85 expect(() => assertBuiltin.strictEqual(1, 1)).not.toThrow();

Callers 1

require.jsFile · 0.85

Calls 2

itFunction · 0.50
fnFunction · 0.50

Tested by

no test coverage detected