mirror of https://github.com/status-im/metro.git
metro: switch Bundler-test to the new memory-fs
Reviewed By: rafeca Differential Revision: D7111251 fbshipit-source-id: dfba2c3e7d17cc90c329785736b7c5a30816305b
This commit is contained in:
parent
cc392c699a
commit
a4d1bf21b3
|
@ -14,7 +14,7 @@ jest
|
||||||
.setMock('jest-worker', () => ({}))
|
.setMock('jest-worker', () => ({}))
|
||||||
.setMock('metro-minify-uglify')
|
.setMock('metro-minify-uglify')
|
||||||
.mock('image-size')
|
.mock('image-size')
|
||||||
.mock('fs')
|
.mock('fs', () => new (require('metro-memory-fs'))())
|
||||||
.mock('os')
|
.mock('os')
|
||||||
.mock('assert')
|
.mock('assert')
|
||||||
.mock('progress')
|
.mock('progress')
|
||||||
|
@ -29,6 +29,7 @@ var sizeOf = require('image-size');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const mkdirp = require('mkdirp');
|
||||||
|
|
||||||
var commonOptions = {
|
var commonOptions = {
|
||||||
allowBundleUpdates: false,
|
allowBundleUpdates: false,
|
||||||
|
@ -60,15 +61,9 @@ describe('Bundler', function() {
|
||||||
|
|
||||||
projectRoots = ['/root'];
|
projectRoots = ['/root'];
|
||||||
|
|
||||||
fs.__setMockFilesystem({
|
mkdirp.sync('/path/to');
|
||||||
path: {to: {'transformer.js': ''}},
|
mkdirp.sync('/root');
|
||||||
});
|
fs.writeFileSync('/path/to/transformer.js', '');
|
||||||
|
|
||||||
fs.statSync.mockImplementation(function() {
|
|
||||||
return {
|
|
||||||
isDirectory: () => true,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
assetServer = {
|
assetServer = {
|
||||||
getAssetData: jest.fn(),
|
getAssetData: jest.fn(),
|
||||||
|
|
Loading…
Reference in New Issue