test(theme-common): improve test coverage (#6902)

* test(theme-common): improve test coverage

* revert
This commit is contained in:
Joshua Chen 2022-03-12 13:17:21 +08:00 committed by GitHub
parent aa5a2d4c04
commit f6baaa6b75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 1183 additions and 755 deletions

View file

@ -67,28 +67,28 @@ describe('readOutputHTMLFile', () => {
path.join(__dirname, '__fixtures__/build-snap'),
undefined,
).then(String),
).resolves.toEqual('file\n');
).resolves.toBe('file\n');
await expect(
readOutputHTMLFile(
'/folder',
path.join(__dirname, '__fixtures__/build-snap'),
undefined,
).then(String),
).resolves.toEqual('folder\n');
).resolves.toBe('folder\n');
await expect(
readOutputHTMLFile(
'/file/',
path.join(__dirname, '__fixtures__/build-snap'),
undefined,
).then(String),
).resolves.toEqual('file\n');
).resolves.toBe('file\n');
await expect(
readOutputHTMLFile(
'/folder/',
path.join(__dirname, '__fixtures__/build-snap'),
undefined,
).then(String),
).resolves.toEqual('folder\n');
).resolves.toBe('folder\n');
});
it('trailing slash true', async () => {
await expect(
@ -97,14 +97,14 @@ describe('readOutputHTMLFile', () => {
path.join(__dirname, '__fixtures__/build-snap'),
true,
).then(String),
).resolves.toEqual('folder\n');
).resolves.toBe('folder\n');
await expect(
readOutputHTMLFile(
'/folder/',
path.join(__dirname, '__fixtures__/build-snap'),
true,
).then(String),
).resolves.toEqual('folder\n');
).resolves.toBe('folder\n');
});
it('trailing slash false', async () => {
await expect(
@ -113,14 +113,14 @@ describe('readOutputHTMLFile', () => {
path.join(__dirname, '__fixtures__/build-snap'),
false,
).then(String),
).resolves.toEqual('file\n');
).resolves.toBe('file\n');
await expect(
readOutputHTMLFile(
'/file/',
path.join(__dirname, '__fixtures__/build-snap'),
false,
).then(String),
).resolves.toEqual('file\n');
).resolves.toBe('file\n');
});
});