forked from goestav/nx-semantic-release
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce [only] flag for including only selected projects for …
…given commit
- Loading branch information
1 parent
28edb28
commit f0c4021
Showing
8 changed files
with
108 additions
and
12 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
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 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 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,60 @@ | ||
import { shouldSkipCommit } from './git'; | ||
|
||
describe('git', () => { | ||
describe('shouldSkipCommit', () => { | ||
it('should skip commit if [skip project] flag is set', () => { | ||
const result = shouldSkipCommit( | ||
{ | ||
body: '[skip project]', | ||
}, | ||
'project' | ||
); | ||
|
||
expect(result).toEqual(true); | ||
}); | ||
|
||
it('should skip commit if [skip all] flag is set', () => { | ||
const result = shouldSkipCommit( | ||
{ | ||
body: '[skip all]', | ||
}, | ||
'project' | ||
); | ||
|
||
expect(result).toEqual(true); | ||
}); | ||
|
||
it('should not skip commit if [skip project] flag is not set in the body', () => { | ||
const result = shouldSkipCommit( | ||
{ | ||
body: '', | ||
}, | ||
'project' | ||
); | ||
|
||
expect(result).toEqual(false); | ||
}); | ||
|
||
it('should skip commit if it has [only other-project] flag', () => { | ||
const result = shouldSkipCommit( | ||
{ | ||
body: '[only other-project]', | ||
}, | ||
'project' | ||
); | ||
|
||
expect(result).toEqual(true); | ||
}); | ||
|
||
it('should not skip commit if it includes [only project] flag', () => { | ||
const result = shouldSkipCommit( | ||
{ | ||
body: '[only project]', | ||
}, | ||
'project' | ||
); | ||
|
||
expect(result).toEqual(false); | ||
}); | ||
}); | ||
}); |
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 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 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 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