Skip to content
Prev Previous commit
Next Next commit
Added integration test for describe with a class or function
  • Loading branch information
Josh Goldberg committed Dec 23, 2017
commit 79a11aaf807571e87fb5e1e0631e6d633618618f
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,11 @@ Time: <<REPLACED>>
Ran all test suites.
"
`;

exports[`function as descriptor`] = `
"PASS __tests__/function-as-descriptor.test.js
Foo
✓ it

"
`;
18 changes: 18 additions & 0 deletions integration_tests/__tests__/globals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,21 @@ test('tests with no implementation with expand arg', () => {
expect(rest).toMatchSnapshot();
expect(summary).toMatchSnapshot();
});

test('function as descriptor', () => {
const filename = 'function-as-descriptor.test.js';
const content = `
function Foo() {}
describe(Foo, () => {
it('it', () => {});
});
`;

writeFiles(TEST_DIR, {[filename]: content});
const {stderr, status} = runJest(DIR);
expect(status).toBe(0);

const {summary, rest} = extractSummary(stderr);
expect(rest).toMatchSnapshot();
expect(summary).toMatchSnapshot();
});