vendredi 10 août 2018

Jest not outputting describe names nor test names when more than one test file

TLDR

When running Jest (23.5.0) with only one file, it outputs 'describe names' and 'test names'. I want Jest to output 'describe names' and 'test names' when running with multiple test files, but it seems to be automatically suppressing.

TMI

Example:

 PASS  src/components/UsersTable.test.jsx
  UsersTable
    ✓ is a table (4ms)
    ✓ has columns 'first', 'last', 'email' (1ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        1.768s, estimated 2s
Ran all test suites.

When running with two, it suppresses. Example:

 PASS  src/components/UsersTableRow.test.jsx
 PASS  src/components/UsersTable.test.jsx

Test Suites: 2 passed, 2 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        2.254s
Ran all test suites.

Partial code sample:

describe('UsersTable', () => {
    const component = renderer.create(
        <UsersTable />
    );
    const usersTable = component.toJSON();

    test('is a table', () => {
        expect(usersTable.type).toBe('table');
    });

Removing 'test' from the name of either file such that only one of the two tests runs at a time, results in successful desired output of name details for either file. TLDR: Both files work alone.

Aucun commentaire:

Enregistrer un commentaire