Improve fixture test output (#2266)

This commit is contained in:
Opender Singh 2020-06-09 11:14:18 +12:00 committed by GitHub
parent edf874ce5c
commit 37a711eb6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ const fixturesPath = path.join(__dirname, './fixtures');
const fixtures = fs.readdirSync(fixturesPath); const fixtures = fs.readdirSync(fixturesPath);
describe('Fixtures', () => { describe('Fixtures', () => {
for (const name of fixtures) { describe.each(fixtures)('Import %s', name => {
const dir = path.join(fixturesPath, `./${name}`); const dir = path.join(fixturesPath, `./${name}`);
const inputs = fs.readdirSync(dir).filter(name => !!name.match(/^(.+)-?input\.[^.]+$/)); const inputs = fs.readdirSync(dir).filter(name => !!name.match(/^(.+)-?input\.[^.]+$/));
@ -20,7 +20,7 @@ describe('Fixtures', () => {
continue; continue;
} }
it(`Import ${name} ${input}`, async () => { it(input, async () => {
expect.assertions(5); expect.assertions(5);
expect(typeof input).toBe('string'); expect(typeof input).toBe('string');
expect(typeof output).toBe('string'); expect(typeof output).toBe('string');
@ -49,5 +49,5 @@ describe('Fixtures', () => {
} }
}); });
} }
} });
}); });