-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for getGraphId + calcTransformerOptions
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @emails oncall+metro_bundler | ||
* @format | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const {calcTransformerOptions} = require('../transformHelpers'); | ||
|
||
describe('calcTransformerOptions', () => { | ||
const entryFiles = []; | ||
const bundler = {}; | ||
const deltaBundler = {}; | ||
const options = {}; | ||
|
||
it('returns `unstable_disableModuleWrapping: false` by default', async () => { | ||
const transformOptions = await calcTransformerOptions( | ||
entryFiles, | ||
bundler, | ||
deltaBundler, | ||
{ | ||
transformer: { | ||
getTransformOptions: async () => ({ | ||
transform: {}, | ||
}), | ||
}, | ||
}, | ||
options, | ||
); | ||
expect(transformOptions.unstable_disableModuleWrapping).toBe(false); | ||
}); | ||
|
||
it('returns `unstable_disableModuleWrapping`', async () => { | ||
const transformOptions = await calcTransformerOptions( | ||
entryFiles, | ||
bundler, | ||
deltaBundler, | ||
{ | ||
transformer: { | ||
getTransformOptions: async () => ({ | ||
transform: { | ||
unstable_disableModuleWrapping: true, | ||
}, | ||
}), | ||
}, | ||
}, | ||
options, | ||
); | ||
expect(transformOptions.unstable_disableModuleWrapping).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters