diff --git a/@commitlint/read/package.json b/@commitlint/read/package.json index 89b93d8928..703026c6ef 100644 --- a/@commitlint/read/package.json +++ b/@commitlint/read/package.json @@ -11,29 +11,8 @@ "deps": "dep-check", "pkg": "pkg-check --skip-import", "start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"", - "test": "ava -c 4 --verbose", "watch": "babel src --out-dir lib --watch --source-maps" }, - "ava": { - "files": [ - "src/**/*.test.js", - "!lib/**/*" - ], - "source": [ - "src/**/*.js", - "!lib/**/*" - ], - "babel": { - "testOptions": { - "presets": [ - "babel-preset-commitlint" - ] - } - }, - "require": [ - "@babel/register" - ] - }, "babel": { "presets": [ "babel-preset-commitlint" @@ -67,7 +46,6 @@ "@babel/register": "7.7.7", "@commitlint/test": "8.2.0", "@commitlint/utils": "^8.3.4", - "ava": "2.4.0", "babel-preset-commitlint": "^8.2.0", "concurrently": "3.6.1", "cross-env": "6.0.3", diff --git a/@commitlint/read/src/index.test.js b/@commitlint/read/src/index.test.js index 4c4b93c4a7..87a4fbb133 100644 --- a/@commitlint/read/src/index.test.js +++ b/@commitlint/read/src/index.test.js @@ -1,21 +1,20 @@ import {git} from '@commitlint/test'; -import test from 'ava'; import execa from 'execa'; import * as sander from '@marionebl/sander'; import read from '.'; -test('get edit commit message specified by the `edit` flag', async t => { +test('get edit commit message specified by the `edit` flag', async () => { const cwd = await git.bootstrap(); await sander.writeFile(cwd, 'commit-msg-file', 'foo'); const expected = ['foo\n']; const actual = await read({edit: 'commit-msg-file', cwd}); - t.deepEqual(actual, expected); + expect(actual).toEqual(expected); }); -test('get edit commit message from git root', async t => { +test('get edit commit message from git root', async () => { const cwd = await git.bootstrap(); await sander.writeFile(cwd, 'alpha.txt', 'alpha'); @@ -23,10 +22,10 @@ test('get edit commit message from git root', async t => { await execa('git', ['commit', '-m', 'alpha'], {cwd}); const expected = ['alpha\n\n']; const actual = await read({edit: true, cwd}); - t.deepEqual(actual, expected); + expect(actual).toEqual(expected); }); -test('get history commit messages', async t => { +test('get history commit messages', async () => { const cwd = await git.bootstrap(); await sander.writeFile(cwd, 'alpha.txt', 'alpha'); await execa('git', ['add', 'alpha.txt'], {cwd}); @@ -36,10 +35,10 @@ test('get history commit messages', async t => { const expected = ['remove alpha\n\n', 'alpha\n\n']; const actual = await read({cwd}); - t.deepEqual(actual, expected); + expect(actual).toEqual(expected); }); -test('get edit commit message from git subdirectory', async t => { +test('get edit commit message from git subdirectory', async () => { const cwd = await git.bootstrap(); await sander.mkdir(cwd, 'beta'); await sander.writeFile(cwd, 'beta/beta.txt', 'beta'); @@ -49,5 +48,5 @@ test('get edit commit message from git subdirectory', async t => { const expected = ['beta\n\n']; const actual = await read({edit: true, cwd}); - t.deepEqual(actual, expected); + expect(actual).toEqual(expected); }); diff --git a/jest.config.js b/jest.config.js index 8ef1d77fda..4e334e0d5d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,5 +2,8 @@ module.exports = { preset: 'ts-jest/presets/js-with-babel', testEnvironment: 'node', testRegex: undefined, - testMatch: ['**/*.test.ts?(x)'] + testMatch: [ + '**/*.test.ts?(x)', + '**/@commitlint/read/src/*.test.js?(x)' + ] };