Skip to content

Commit

Permalink
refactor: Place tests with features
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwiens committed Aug 18, 2017
1 parent 84b8667 commit 95bc89a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 19 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:verbose": "npm run test -- --verbose",
"test:coverage": "npm run clean:coverage && npm run test -- --coverage",
"report-codeclimate": "codeclimate-test-reporter < coverage/lcov.info",
"lint": "tslint --type-check --project tsconfig.json -c ./tslint.json 'src/**/*.ts' --exclude 'src/**/*.d.ts'",
"lint": "tslint --type-check --project tsconfig.json -c ./tslint.json 'src/**/*.ts' --exclude 'src/**/*.d.ts' --exclude 'src/**/*.spec.ts'",
"certs": "bash ./.ssl/generateLocalCerts.sh 'localhost'",
"security": "nsp check",
"transpile": "tsc"
Expand Down Expand Up @@ -68,10 +68,15 @@
"typescript": "^2.4.2"
},
"jest": {
"globals": {
"ts-jest": {
"tsConfigFile": "tsconfig.spec.json"
}
},
"transform": {
".(ts)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/test/.*|\\.(test|spec))\\.(ts|js)$",
"testRegex": "(/src/.*\\.spec)\\.ts",
"moduleFileExtensions": [
"ts",
"js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Environments } from '../src/shared/environments';
import { Environments } from './environments';

describe('Environment', () => {
test('getName() should return the test env', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
GoneException,
UnsupportedMediaException,
TooManyRequestsException,
} from '../src/shared/exceptions';
} from '../../shared/exceptions';

describe('HTTP Exceptions', () => {
test('BAD_REQUEST: Should have the correct properties', () => {
Expand Down
19 changes: 4 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,13 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"lib": [
"es6",
"es2016.array.include"
],
"lib": ["es6", "es2016.array.include"],
"sourceMap": true,
"allowJs": true,
"pretty": true,
"outDir": "./dist"
},
"typeRoots": [
"node_modules/@types",
"src/core/types/*"
],
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
"typeRoots": ["node_modules/@types", "src/core/types/*"],
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
25 changes: 25 additions & 0 deletions tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compileOnSave": false,
"compilerOptions": {
"module": "commonjs",
"declaration": false,
"importHelpers": true,
"noImplicitAny": false,
"noImplicitThis": true,
"noUnusedLocals": true,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"lib": [
"es6",
"es2016.array.include"
],
"sourceMap": true,
"allowJs": true,
"pretty": true
},
"files": ["setupJest.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}

0 comments on commit 95bc89a

Please sign in to comment.