Skip to content

Conversation

@marionebl
Copy link
Contributor

No description provided.

.sort()
.filter(item => !ignore.includes(item));
const actual = Object.keys(ensure).sort();
expect(actual).toEqual(expected);
Copy link
Contributor

@armano2 armano2 Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(actual).toEqual(expected);
expect(actual).toMatchObject(expected);

and you should be able to remove sorting

test('exports all checkers', async () => { const ignore = ['types']; const expected = (await glob('*.ts')) .map(f => camelCase(f)) .filter(item => !ignore.includes(item)); const actual = Object.keys(ensure); expect(actual).toMatchObject(expected); });

toMatchObject works on arrays

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know! I go with the current approach as this is supposed to test if we forgot to reexport any checker from the directory. So failing for a new file that is not exported from index.js is the expected behavior

@marionebl marionebl merged commit c63cf33 into master Feb 5, 2020
@marionebl marionebl deleted the chore-enable-isolated-modules branch February 5, 2020 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants