mirror of https://github.com/status-im/metro.git
Bring back polyfill test
Reviewed By: jeanlauliac Differential Revision: D4642517 fbshipit-source-id: 0882f453eb91c9f12a9e507ccfa60873106d2d71
This commit is contained in:
parent
4681082e17
commit
20da966546
|
@ -131,6 +131,13 @@ describe('Resolver', function() {
|
|||
}));
|
||||
});
|
||||
|
||||
const polyfill = {
|
||||
id: 'polyfills/Object.es6.js',
|
||||
file: 'polyfills/Object.es6.js',
|
||||
dependencies: [],
|
||||
};
|
||||
DependencyGraph.prototype.createPolyfill.mockReturnValueOnce(polyfill);
|
||||
|
||||
return depResolver
|
||||
.getDependencies(
|
||||
'/root/index.js',
|
||||
|
@ -141,6 +148,11 @@ describe('Resolver', function() {
|
|||
).then(function(result) {
|
||||
expect(result.mainModuleId).toEqual('index');
|
||||
expect(result.dependencies[result.dependencies.length - 1]).toBe(module);
|
||||
|
||||
expect(DependencyGraph.mock.instances[0].getDependencies)
|
||||
.toBeCalledWith({entryPath: '/root/index.js', recursive: true});
|
||||
expect(result.dependencies[0]).toEqual(polyfill);
|
||||
|
||||
expect(
|
||||
DependencyGraph
|
||||
.prototype
|
||||
|
|
Loading…
Reference in New Issue