Skip to content

Commit

Permalink
test: Add test for user-overridden customExportConditions via a custo…
Browse files Browse the repository at this point in the history
…m env
  • Loading branch information
huntie committed Mar 7, 2023
1 parent 39f3bed commit 499117d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment <rootDir>/custom-env.js
* @jest-environment-options {"customExportConditions": ["react-native"]}
*/

import {fn} from 'fake-dual-dep';

test('returns correct message', () => {
expect(fn()).toBe('hello from react native');
});
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment <rootDir>/deno-env.js
* @jest-environment <rootDir>/custom-env.js
*/

import {fn} from 'fake-dual-dep';
Expand Down
Expand Up @@ -9,8 +9,6 @@

const NodeEnv = require('jest-environment-node').TestEnvironment;

module.exports = class DenoEnvWithConditions extends NodeEnv {
exportConditions() {
return ['deno'];
}
module.exports = class CustomEnvWithConditions extends NodeEnv {
customExportConditions = ['deno'];
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions e2e/resolve-conditions/node_modules/fake-dual-dep/react-native.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 499117d

Please sign in to comment.