Skip to content

Commit

Permalink
fixed coverage + minor func arg fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed May 31, 2022
1 parent 847f4dd commit 11d0d30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/locator/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function locateFilesSync(
}

export function locateFileSync(
pattern: string,
pattern: string | string[],
options?: Partial<LocatorOptions>,
) : LocatorInfo | undefined {
options = buildLocatorOptions(options);
Expand Down
8 changes: 4 additions & 4 deletions test/unit/locator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const basePath = path.join(__dirname, '..', 'data');

describe('src/locator.ts', () => {
it('should not locate .js file', async () => {
let locatorInfo = await locateFile( 'file.{js,ts}', {path: [basePath]});
let locatorInfo = await locateFile( ['file.ts', 'file.js'], {path: [basePath]});
expect(locatorInfo).toBeDefined();
expect(locatorInfo).toEqual({
path: basePath,
fileName: 'file',
fileExtension: '.js'
} as LocatorInfo);

locatorInfo = locateFileSync( 'file.{js,ts}', {path: [basePath]});
locatorInfo = locateFileSync( ['file.ts', 'file.js'], {path: [basePath]});
expect(locatorInfo).toBeDefined();
expect(locatorInfo).toEqual({
path: basePath,
Expand All @@ -32,15 +32,15 @@ describe('src/locator.ts', () => {
});

it('should not locate .js files', async () => {
let locatorInfo = await locateFiles( 'file.{js,ts}', {path: [basePath]});
let locatorInfo = await locateFiles( ['file.ts', 'file.js'], {path: [basePath]});
expect(locatorInfo).toBeDefined();
expect(locatorInfo).toEqual([{
path: basePath,
fileName: 'file',
fileExtension: '.js'
}] as LocatorInfo[]);

locatorInfo = locateFilesSync( 'file.{js,ts}', {path: [basePath]});
locatorInfo = locateFilesSync( ['file.ts', 'file.js'], {path: [basePath]});
expect(locatorInfo).toBeDefined();
expect(locatorInfo).toEqual([{
path: basePath,
Expand Down

0 comments on commit 11d0d30

Please sign in to comment.