Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
21 clean up tests (#22)
Browse files Browse the repository at this point in the history
* move jest config to seperate file

* move tests to be inline

* omit spec files from tsconfig
  • Loading branch information
andyrichardson committed Aug 25, 2018
1 parent 5539781 commit 7038bcf
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 16 deletions.
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
moduleFileExtensions: ['ts', 'tsx', 'js'],
transform: {
'\\.(ts|tsx)$': 'ts-jest',
},
testRegex: '/src/.*\\.spec.(ts|tsx|js)$',
};
11 changes: 0 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@
"fs": "0.0.1-security",
"request": "^2.81.0"
},
"jest": {
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"\\.(ts|tsx)$": "ts-jest"
},
"testRegex": "/spec/.*\\.spec.(ts|tsx|js)$"
},
"devDependencies": {
"@types/atom": "^1.26.0",
"@types/chai": "^4.1.2",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import Settings from '../../src/config/settings';
import Settings from './settings';

it('should export an object', () => {
expect(Settings).to.be.an('object');
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/notifier.spec.ts → src/lib/notifier.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Notifier from '../../src/lib/notifier';
import * as Notifier from './notifier';

declare const global: any;

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/package.spec.ts → src/lib/package.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import Package from '../../src/lib/package';
import Package from './package';

it('should construct', () => {
expect(new Package()).to.be.an('object');
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/updater.spec.ts → src/lib/updater.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import { Updater } from '../../src/lib/updater';
import { Updater } from './updater';

declare const global: any;

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"strict": true,
"target": "ES3"
},
"include": ["./src/*.ts", "./src/**/*.ts"]
"include": ["./src/*.ts", "./src/**/*.ts"],
"exclude": ["./src/*.spec.ts", "./src/**/*.spec.ts"]
}

0 comments on commit 7038bcf

Please sign in to comment.