Skip to content

Commit

Permalink
Copy in integrations tests from pull jestjs#5241
Browse files Browse the repository at this point in the history
Done at the request of @SimenB from PR jestjs#5972
  • Loading branch information
stieg committed Apr 12, 2018
1 parent a3242ff commit 89d612a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions integration-tests/__tests__/module_parent_null_in_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
'use strict';

const runJest = require('../runJest');

test('module.parent should be null in test files', () => {
const {status} = runJest('module_parent_null_in_test');

expect(status).toBe(0);
});
13 changes: 13 additions & 0 deletions integration-tests/module_parent_null_in_test/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

test('moduleNameMapping wrong configuration', () => {
expect(module).not.toBe(module.parent);
expect(module.parent).toBeNull();
});
3 changes: 3 additions & 0 deletions integration-tests/module_parent_null_in_test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jest": {}
}

0 comments on commit 89d612a

Please sign in to comment.