Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression on non-matching suites (#6415) #6657

Merged
merged 1 commit into from
Jul 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- `[jest-runner]` Force parallel runs for watch mode, to avoid TTY freeze ([#6647](https://github.com/facebook/jest/pull/6647))
- `[jest-cli]` properly reprint resolver errors in watch mode ([#6407](https://github.com/facebook/jest/pull/6407))
- `[jest-cli]` Write configuration to stdout when the option was explicitly passed to Jest ([#6447](https://github.com/facebook/jest/pull/6447))
- `[jest-cli]` Fix regression on non-matching suites ([6657](https://github.com/facebook/jest/pull/6657))

## 23.3.0

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`testNamePattern skipped 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 skipped, 1 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites with tests matching \\"false\\"."
`;
23 changes: 23 additions & 0 deletions e2e/__tests__/test_name_pattern_skipped.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* 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 {extractSummary} = require('../Utils');
const runJest = require('../runJest');

test('testNamePattern skipped', () => {
const {stderr, status} = runJest.json('testNamePattern_skipped', [
'--testNamePattern',
'false',
]);
const {summary} = extractSummary(stderr);

expect(status).toBe(0);
expect(summary).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* 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';

describe('First suite', () => {
it('true equals true', () => {
expect(true).toBe(true);
});
});

describe('Second suite', () => {
it('false equals false', () => {
expect(false).toBe(false);
});
});
5 changes: 5 additions & 0 deletions e2e/testNamePattern_skipped/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"jest": {
"testEnvironment": "node"
}
}
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/src/tree_processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function treeProcessor(options: Options) {
fn: getNodeHandler(child, enabled),
}));
if (!hasEnabledTest(node)) {
return [];
return children;
}
return node.beforeAllFns.concat(children).concat(node.afterAllFns);
}
Expand Down