Skip to content

Commit

Permalink
feat: Update project structure
Browse files Browse the repository at this point in the history
Chainging to jest from ava. Updating most scripts. Updating tslint to
use tabs.
  • Loading branch information
stephan-nordnes-eriksen committed Feb 24, 2018
1 parent 6a2f55f commit 1d88e62
Show file tree
Hide file tree
Showing 5 changed files with 1,414 additions and 43 deletions.
18 changes: 18 additions & 0 deletions jest.config.js
@@ -0,0 +1,18 @@
module.exports = {
globals: {
'ts-jest': {
tsConfigFile: 'tsconfig.json'
}
},
moduleFileExtensions: [
'ts',
'js'
],
transform: {
'^.+\\.(ts|tsx)$': './node_modules/ts-jest/preprocessor.js'
},
testMatch: [
'**/__tests__/**/*.(spec|test).(ts|js)'
],
testEnvironment: 'node'
};
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -42,10 +42,10 @@
"build:resolve-sourcemaps": "sorcery -i build/browser/index.js && sorcery -i build/browser/index.cjs.js",
"build:tests": "trash test && node config/exports/build-tests.js",
"lint": "tslint --project . --type-check src/**/*.ts",
"unit": "jest",
"unit": "jest --coverage",
"check-coverage": "nyc check-coverage --lines 100 --functions 100 --branches 100",
"test": "yarn lint && yarn unit && yarn check-coverage",
"watch": "yarn build && yarn build:tests -- --no-browser && concurrently -r --kill-others \"npm run --silent build:main -- -w\" \"npm run --silent build:tests -- -w --no-browser\" \"sleepms 2000 && ava --watch\"",
"watch": "jest --watch",
"cov": "yarn unit && yarn html-coverage && opn coverage/index.html",
"html-coverage": "nyc report --reporter=html",
"send-coverage": "nyc report --reporter=lcov > coverage.lcov && codecov",
Expand Down
30 changes: 19 additions & 11 deletions tsconfig.json
@@ -1,27 +1,35 @@
{
"extends": "./config/tsconfig.strict",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "build/main",
"rootDir": "src",
"noImplicitAny": true,
"moduleResolution": "node",
"module": "commonjs",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*",
"src/types/*"
],
"typescript-starter": [
"src/index.ts"
]
},
"declaration": true,
"importHelpers": true,
"inlineSourceMap": true,
"listFiles": false,
"traceResolution": false,
"pretty": true,
"lib" : [
"lib": [
"es6"
],
"types" : [
"node"
],
"baseUrl": ".", // required for "paths"
"paths": {
"typescript-starter": ["src/index.ts"] // write tests without relative paths
}
"types": [
"node",
"jest"
]
},
"include": [
"src/**/*.ts"
Expand Down
8 changes: 7 additions & 1 deletion tslint.json
@@ -1,3 +1,9 @@
{
"extends": "tslint-config-standard"
"extends": "tslint-config-standard",
"rules": {
"indent": [true, "tabs", 4],
"ter-indent": [true, "tab",{
"SwitchCase": 1
}]
}
}

0 comments on commit 1d88e62

Please sign in to comment.