1- import * as github from '../src/github' ;
2- import { SinonStub , stub } from 'sinon' ;
3- import { getConventionalCommitTypes , lintPullRequest } from '../src/lint' ;
4- import { deepStrictEqual } from 'assert' ;
1+ import { getConventionalCommitTypes , lintPullRequest } from '../lint' ;
52
63describe ( 'getConvetionalCommitTypes tests' , ( ) => {
74 it ( 'should return types' , ( ) => {
85 const types = getConventionalCommitTypes ( ) ;
96
10- deepStrictEqual (
7+ expect (
118 '- **feat**: A new feature\n' +
129 '- **fix**: A bug fix\n' +
1310 '- **docs**: Documentation only changes\n' +
@@ -19,25 +16,11 @@ describe('getConvetionalCommitTypes tests', () => {
1916 '- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\n' +
2017 "- **chore**: Other changes that don't modify src or test files\n" +
2118 '- **revert**: Reverts a previous commit' ,
22- types
23- ) ;
19+ ) . toBe ( types ) ;
2420 } ) ;
2521} ) ;
2622
2723describe ( 'lintPullRequest tests' , ( ) => {
28- let createPrCommentStub : SinonStub ;
29- let deletePrCommentStub : SinonStub ;
30-
31- before ( ( ) => {
32- createPrCommentStub = stub ( github , 'createPrComment' ) ;
33- deletePrCommentStub = stub ( github , 'deletePrComment' ) ;
34- } ) ;
35-
36- after ( ( ) => {
37- createPrCommentStub . restore ( ) ;
38- deletePrCommentStub . restore ( ) ;
39- } ) ;
40-
4124 const tests = [
4225 { args : 'feat: test' , expected : true } ,
4326 { args : 'feat(test): test' , expected : true } ,
@@ -48,7 +31,7 @@ describe('lintPullRequest tests', () => {
4831
4932 tests . forEach ( ( { args, expected} ) => {
5033 it ( `should pass or fail linting ['${ args } ', '${ expected } ']` , async ( ) => {
51- deepStrictEqual ( await lintPullRequest ( args ) , expected ) ;
34+ expect ( await lintPullRequest ( args ) ) . toBe ( expected ) ;
5235 } ) ;
5336 } ) ;
5437} ) ;
0 commit comments