Skip to content

Commit

Permalink
Add win support for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gdman committed Mar 15, 2021
1 parent d174188 commit 50ad690
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/core/collection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(3);
expect(files).toContain('folder1/foldera/json-file.json');
expect(files).toContain('folder1/json-file.json');
expect(files).toContain('folder2/json-file.json');
expect(files).toContain(path.join('folder1', 'foldera', 'json-file.json'));
expect(files).toContain(path.join('folder1', 'json-file.json'));
expect(files).toContain(path.join('folder2', 'json-file.json'));
});

it('construct with base directory and array of patterns can return files', async () => {
Expand All @@ -26,9 +26,9 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(3);
expect(files).toContain('folder1/foldera/json-file.json');
expect(files).toContain('folder1/json-file.json');
expect(files).toContain('folder2/xml-file.xml');
expect(files).toContain(path.join('folder1', 'foldera', 'json-file.json'));
expect(files).toContain(path.join('folder1', 'json-file.json'));
expect(files).toContain(path.join('folder2', 'xml-file.xml'));
});

it('construct with base directory and pattern options can return files (prove options used by adding pattern thats not covered by root dir)', async () => {
Expand All @@ -41,7 +41,7 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(2);
expect(files).toContain('foldera/json-file.json');
expect(files).toContain(path.join('foldera', 'json-file.json'));
expect(files).toContain('xml-file.xml');
});

Expand All @@ -54,9 +54,9 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(6);
expect(files).toContain('foldera/json-file.json');
expect(files).toContain('foldera/xml-file.xml');
expect(files).toContain('foldera/text-file.txt');
expect(files).toContain(path.join('foldera', 'json-file.json'));
expect(files).toContain(path.join('foldera', 'xml-file.xml'));
expect(files).toContain(path.join('foldera', 'text-file.txt'));
expect(files).toContain('json-file.json');
expect(files).toContain('xml-file.xml');
expect(files).toContain('text-file.txt');
Expand All @@ -72,9 +72,9 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(3);
expect(files).toContain('folder1/foldera/json-file.json');
expect(files).toContain('folder1/json-file.json');
expect(files).toContain('folder2/xml-file.xml');
expect(files).toContain(path.join('folder1', 'foldera', 'json-file.json'));
expect(files).toContain(path.join('folder1', 'json-file.json'));
expect(files).toContain(path.join('folder2', 'xml-file.xml'));
});

it('construct with no parameters and setDir can return files', async () => {
Expand All @@ -99,9 +99,9 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(3);
expect(files).toContain('folder1/foldera/json-file.json');
expect(files).toContain('folder1/json-file.json');
expect(files).toContain('folder2/xml-file.xml');
expect(files).toContain(path.join('folder1', 'foldera', 'json-file.json'));
expect(files).toContain(path.join('folder1', 'json-file.json'));
expect(files).toContain(path.join('folder2', 'xml-file.xml'));
});

it('construct with no parameters and setDir + setPatterns can return files (prove options used by adding pattern thats not covered by root dir)', async () => {
Expand All @@ -113,7 +113,7 @@ describe('Collection', () => {
const files = await collection.getFileNames();

expect(files.length).toEqual(2);
expect(files).toContain('foldera/json-file.json');
expect(files).toContain(path.join('foldera', 'json-file.json'));
expect(files).toContain('xml-file.xml');
});

Expand Down

0 comments on commit 50ad690

Please sign in to comment.