-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): use strict proj glob pattern (#495)
- Loading branch information
Showing
9 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { isDryRun } from './args'; | ||
|
||
describe('Args util functions', () => { | ||
describe('isDryRun', () => { | ||
it('Should detect dry run flag', () => { | ||
const before = isDryRun(); | ||
process.argv.push('--dry-run'); | ||
const after = isDryRun(); | ||
expect({ before, after }).toStrictEqual({ before: false, after: true }); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { findProjectFileInPath, findProjectFileInPathSync } from './glob'; | ||
|
||
const dotnetProjectFiles = [ | ||
'packages/utils/fixtures/cs/file.csproj', | ||
'packages/utils/fixtures/fs/file.fsproj', | ||
'packages/utils/fixtures/vb/file.vbproj', | ||
]; | ||
|
||
describe('Glob util functions', () => { | ||
describe('findProjectFileInPath', () => { | ||
it('should find .net project file', async () => { | ||
const result = await Promise.all([ | ||
findProjectFileInPath('packages/utils/fixtures/cs'), | ||
findProjectFileInPath('packages/utils/fixtures/fs'), | ||
findProjectFileInPath('packages/utils/fixtures/vb'), | ||
]); | ||
|
||
expect(result).toEqual(dotnetProjectFiles); | ||
}); | ||
|
||
it('should ignore non .net project files', async () => { | ||
await expect( | ||
findProjectFileInPath('packages/utils/fixtures/other'), | ||
).rejects.toThrow( | ||
`Unable to find a build-able project within project's source directory!`, | ||
); | ||
}); | ||
}); | ||
|
||
describe('findProjectFileInPathSync', () => { | ||
it('should find .net project file synchronously', () => { | ||
const result = [ | ||
findProjectFileInPathSync('packages/utils/fixtures/cs'), | ||
findProjectFileInPathSync('packages/utils/fixtures/fs'), | ||
findProjectFileInPathSync('packages/utils/fixtures/vb'), | ||
]; | ||
|
||
expect(result).toEqual(dotnetProjectFiles); | ||
}); | ||
|
||
it('should ignore non .net project files', () => { | ||
expect(() => | ||
findProjectFileInPathSync('packages/utils/fixtures/other'), | ||
).toThrow( | ||
`Unable to find a build-able project within project's source directory!`, | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.