chore(nestjs) add scripts directory

This commit is contained in:
Kamil Myśliwiec
2018-10-03 17:23:36 +02:00
parent 3a74c790bf
commit f8ffc2d064
5 changed files with 36 additions and 24 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "nestjs",
"version": "5.3.8",
"version": "5.3.10",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -5,14 +5,10 @@
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"precommit": "lint-staged",
"test":
"nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec",
"integration-test":
"mocha integration/**/*.spec.ts --reporter spec --require ts-node/register",
"lint":
"tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
"format":
"prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec",
"integration-test": "mocha integration/**/*.spec.ts --reporter spec --require ts-node/register",
"lint": "tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
"build": "gulp build && gulp move",
"build:lib": "gulp build --dist bundle",
"postinstall": "opencollective",
@@ -21,16 +17,11 @@
"prepare:rc": "npm run build:lib && npm run copy-docs",
"prepare:next": "npm run build:lib && npm run copy-docs",
"prepare:beta": "npm run build:lib && npm run copy-docs",
"publish":
"npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
"publish:rc":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
"publish:next":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:beta":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
"publish:test":
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
"publish": "npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
"publish:rc": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
"publish:next": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:beta": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
"publish:test": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
},
"engines": {
"node": ">= 8.9.0"
@@ -139,7 +130,9 @@
}
},
"nyc": {
"include": ["packages/**/*.ts"],
"include": [
"packages/**/*.ts"
],
"exclude": [
"node_modules/",
"packages/**/*.spec.ts",
@@ -158,13 +151,23 @@
"packages/common/serializer/**/*",
"packages/common/services/logger.service.ts"
],
"extension": [".ts"],
"require": ["ts-node/register"],
"reporter": ["text-summary", "html"],
"extension": [
".ts"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"html"
],
"sourceMap": true,
"instrument": true
},
"lint-staged": {
"packages/**/*.{ts,json}": ["npm run format", "git add"]
"packages/**/*.{ts,json}": [
"npm run format",
"git add"
]
}
}

View File

@@ -0,0 +1,8 @@
# 1. Build fresh packages and move them integration dit
npm run build &>/dev/null
# 2. Start docker containers to perform integration tests
cd integration && docker-compose up -d
# 3. Run integration tests
npm run integration-test

View File

@@ -1,2 +1,3 @@
# Run both unit and integration tests
npm run test
npm run integration-test