-
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.
Add tests to prove that our config is working as expected
- Loading branch information
Fetz
committed
Jul 27, 2018
1 parent
fe18f09
commit bb27c34
Showing
6 changed files
with
1,906 additions
and
176 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,63 @@ | ||
const lint = require('@commitlint/lint'); | ||
const {rules} = require('./'); | ||
|
||
test('should support subjects starting with emoji', async () => { | ||
const {valid, warnings} = await lint('test: 🤖 improve testing', rules); | ||
|
||
expect(valid).toBe(true); | ||
expect(warnings).toEqual([]); | ||
}); | ||
|
||
test('should support a mol full complete message', async () => { | ||
const message = `fix: remove setConfig method | ||
Remove setConfig method that was clashing with global configuration | ||
handler and preventing other components configuration reading | ||
affects: @mol/videojs-vast-vpaid | ||
BREAKING CHANGE: The setConfig method has been removed. | ||
Issues: MOL-4321`; | ||
|
||
const {valid, warnings} = await lint(message, rules); | ||
|
||
expect(valid).toBe(true); | ||
expect(warnings).toEqual([]); | ||
}); | ||
|
||
test('should allow github multiple authors commit message', async () => { | ||
const message = `fix: allow multiple authors | ||
Message body, here will be the body of the message | ||
Co-authored-by: name <[email protected]> | ||
Co-authored-by: another-name <[email protected]>`; | ||
|
||
const {valid, warnings} = await lint(message, rules); | ||
|
||
expect(valid).toBe(true); | ||
expect(warnings).toEqual([]); | ||
}); | ||
|
||
test('should allow a mol full complete message with github multiple authors commit message', async () => { | ||
const message = `fix: allow multiple authors | ||
Remove setConfig method that was clashing with global configuration | ||
handler and preventing other components configuration reading | ||
affects: @mol/videojs-vast-vpaid | ||
BREAKING CHANGE: The setConfig method has been removed. | ||
Issues: MOL-4321 | ||
Co-authored-by: name <[email protected]> | ||
Co-authored-by: another-name <[email protected]>`; | ||
|
||
const {valid, warnings} = await lint(message, rules); | ||
|
||
expect(valid).toBe(true); | ||
expect(warnings).toEqual([]); | ||
}); |
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
Oops, something went wrong.