function resolve(module) { return require.resolve( path.join(process.env.PROJECTPATH, "node_modules", module) ); }
const requireUncached = module => { // invalidate cache for HMR to work in dev mode if (process.env.NODE_ENV !== "production") delete require.cache[require.resolve(module)]; return require(module); }
mods.forEach(mod => { fs.writeFileSync( require.resolve(mod[0]), fs.readFileSync(path.join(__dirname, "mods", mod[1]), "utf8"), "utf8" ); });
function bundleNode(componentPath, fullBundlePath, basePath, bundlePath) { return new Promise((resolve, reject) => { const parameters = [componentPath, fullBundlePath, basePath, bundlePath]; const options = { stdio: [0, 1, 2, "ipc"] }; childProcess = fork(require.resolve("./bundleNode"), parameters, options); // process doesn't exit in watch mode. childProcess.on("message", data => { resolve(); }); }); }
test('throws when prettyPrint is true but pino-pretty module is not installed', async ({ throws, is }) => { // pino pretty *is* installed, and probably also cached, so rather than // messing with the filesystem the simplest way to generate a not found // error is to simulate it: const prettyFactory = require('pino-pretty') require.cache[require.resolve('pino-pretty')].exports = () => { throw Error('Cannot find module \'pino-pretty\'') } throws(() => pino({ prettyPrint: true })) try { pino({ prettyPrint: true }) } catch ({ message }) { is(message, 'Missing `pino-pretty` module: `pino-pretty` must be installed separately') } require.cache[require.resolve('pino-pretty')].exports = prettyFactory })
beforeAll(async function(state) { const DEVTOOLS_DIR = path.dirname( require.resolve('chrome-devtools-frontend/front_end/shell.json')); const frontendFolder = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-frontend-')); await new ReleaseBuilder([ path.join(__dirname, '..', 'front_end'), DEVTOOLS_DIR, path.join(__dirname, '..'), path.join(__dirname, '..', '..', '..') ], frontendFolder).buildApp('integration_test_runner'); state.frontendFolder = frontendFolder; });
const requireUncached = module => { // invalidate cache for HMR to work in dev mode if (process.env.NODE_ENV !== "production") delete require.cache[require.resolve(module)]; return require(module); }
const requireUncached = module => { // invalidate cache for HMR to work in dev mode if (process.env.NODE_ENV !== "production") delete require.cache[require.resolve(module)]; return require(module); }
const requireUncached = module => { // invalidate cache for HMR to work in dev mode if (process.env.NODE_ENV !== "production") delete require.cache[require.resolve(module)]; return require(module); }
mods.forEach(mod => { fs.writeFileSync( require.resolve(mod[0]), fs.readFileSync(path.join(__dirname, "mods", mod[1]), "utf8"), "utf8" ); });
const requireUncached = module => { // invalidate cache for HMR to work in dev mode if (process.env.NODE_ENV !== "production") delete require.cache[require.resolve(module)]; return require(module); }
function resolve(module) { return require.resolve( path.join(process.env.PROJECTPATH, "node_modules", module) ); }
function bundleNode(componentPath, fullBundlePath, basePath, bundlePath) { return new Promise((resolve, reject) => { const parameters = [componentPath, fullBundlePath, basePath, bundlePath]; const options = { stdio: [0, 1, 2, "ipc"] }; childProcess = fork(require.resolve("./bundleNode"), parameters, options); // process doesn't exit in watch mode. childProcess.on("message", data => { resolve(); }); }); }
function bundleNode(componentPath, fullBundlePath, basePath, bundlePath) { return new Promise((resolve, reject) => { const parameters = [componentPath, fullBundlePath, basePath, bundlePath]; const options = { stdio: [0, 1, 2, "ipc"] }; childProcess = fork(require.resolve("./bundleNode"), parameters, options); // process doesn't exit in watch mode. childProcess.on("message", data => { resolve(); }); }); }
function bundleNode(componentPath, fullBundlePath, basePath, bundlePath) { return new Promise((resolve, reject) => { const parameters = [componentPath, fullBundlePath, basePath, bundlePath]; const options = { stdio: [0, 1, 2, "ipc"] }; childProcess = fork(require.resolve("./bundleNode"), parameters, options); // process doesn't exit in watch mode. childProcess.on("message", data => { resolve(); }); }); }