Bring back polyfill test

Reviewed By: jeanlauliac

Differential Revision: D4642517

fbshipit-source-id: 0882f453eb91c9f12a9e507ccfa60873106d2d71
This commit is contained in:
Christoph Pojer 2017-03-02 05:23:22 -08:00 committed by Facebook Github Bot
parent 4681082e17
commit 20da966546
1 changed files with 12 additions and 0 deletions

View File

@ -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