Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
jest.mock('fs');
jest.mock('pkg-dir');
jest.mock('webpack-assets-manifest');
jest.mock('../../Utilities/loadEnvironment');
jest.mock('../plugins/RootComponentsPlugin');
jest.mock('../PWADevServer');
const fs = require('fs');
const pkgDir = require('pkg-dir');
const WebpackAssetsManifest = require('webpack-assets-manifest');
const RootComponentsPlugin = require('../plugins/RootComponentsPlugin');
const loadEnvironment = require('../../Utilities/loadEnvironment');
const configureWebpack = require('../configureWebpack');
pkgDir.mockImplementation(x => x);
const mockStat = (dir, file, err = null) => {
fs.stat.mockImplementationOnce((_, callback) =>
callback(err, { isDirectory: () => dir, isFile: () => file })
);
};
const mockEnv = prod =>
loadEnvironment.mockReturnValueOnce({
env: process.env,
sections: jest.fn(),
section: jest.fn(),
isProd: prod
});
const simulate = {