Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import invariant from 'assert';
import Parcel, {createWorkerFarm} from '@parcel/core';
import defaultConfigContents from '@parcel/config-default';
import assert from 'assert';
import vm from 'vm';
import {NodeFS, MemoryFS, OverlayFS, ncp as _ncp} from '@parcel/fs';
import path from 'path';
import WebSocket from 'ws';
import nullthrows from 'nullthrows';
import {makeDeferredWithPromise} from '@parcel/utils';
import _chalk from 'chalk';
import resolve from 'resolve';
import {NodePackageManager} from '@parcel/package-manager';
const workerFarm = createWorkerFarm();
export const inputFS = new NodeFS();
export let outputFS = new MemoryFS(workerFarm);
export let overlayFS = new OverlayFS(outputFS, inputFS);
beforeEach(() => {
outputFS = new MemoryFS(workerFarm);
overlayFS = new OverlayFS(outputFS, inputFS);
});
// Recursively copies a directory from the inputFS to the outputFS
export async function ncp(source: FilePath, destination: FilePath) {
await _ncp(inputFS, source, outputFS, destination);
}
// Mocha is currently run with exit: true because of this issue preventing us
// from properly ending the workerfarm after the test run: