tests: Makefile is now the main truth, away from npm

This commit is contained in:
Tom Gallacher 2016-10-27 16:01:32 +01:00
parent e75942af75
commit dd259be965
10 changed files with 464 additions and 351 deletions

View File

@ -12,12 +12,12 @@ clean:
.PHONY: test
test:
./node_modules/.bin/ava
$(shell yarn bin)/ava $(TEST_ARGS)
.PHONY: start
start:
npm run start
yarn run start
.PHONY: lint
lint:
@$(shell npm bin)/eslint src
@$(shell yarn bin)/eslint src

View File

@ -20,8 +20,8 @@ Create `credentials.json`, TODO, use environment variables.
### Install Dependencies and run
```bash
npm install
npm start
yarn install
yarn start
```
### Visit GraphiQL

View File

@ -5,7 +5,8 @@
"version": "1.0.0",
"main": "src/index.js",
"scripts": {
"start": "node src/index.js"
"start": "node src/index.js",
"test": "make test"
},
"dependencies": {
"bunyan": "^1.8.1",

View File

@ -10,9 +10,13 @@ install-production: compile clean
clean:
@rm -rf node_modules
bindir := $(shell yarn bin)
AVA := $(bindir)/ava
NYC := $(bindir)/nyc
.PHONY: test
test:
npm run test
BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js $(TEST_ARGS)
.PHONY: compile
compile: install
@ -20,8 +24,8 @@ compile: install
.PHONY: start
start:
npm run production
yarn run production
.PHONY: lint
lint:
@$(shell npm bin)/eslint src
@$(shell yarn bin)/eslint .

View File

@ -11,8 +11,8 @@
"scripts": {
"start": "webpack-dev-server --open --config webpack/index.js",
"production": "node server",
"lint": "eslint .",
"test": "BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(pwd)/webpack/index.js nyc ava test/*.js --verbose",
"lint": "make lint",
"test": "make test",
"open": "nyc report --reporter=html & open coverage/index.html",
"coverage": "nyc check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"build-locales": " CONFIG=$(pwd)/webpack/index.js NODE_ENV=test babel-node scripts/build-locales"

View File

@ -20,5 +20,8 @@
"homepage": "https://github.com/yldio/joyent-dashboard#readme",
"dependencies": {
"husky": "^0.11.9"
},
"devDependencies": {
"tap-xunit": "^1.4.0"
}
}

View File

@ -1,6 +1,10 @@
bindir := $(shell yarn bin)
AVA := $(bindir)/ava
NYC := $(bindir)/nyc
.PHONY: test
test:
yarn run test
BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(shell pwd)/webpack/index.js $(NYC) $(AVA) test/*.js $(TEST_ARGS)
.PHONY: install
install:
@ -16,4 +20,4 @@ clean:
.PHONY: lint
lint:
@$(shell npm bin)/eslint src
@$(shell yarn bin)/eslint .

View File

@ -5,8 +5,8 @@
"license": "private",
"scripts": {
"start": "webpack-dev-server --config webpack/index.js",
"lint": "eslint .",
"test": "BABEL_DISABLE_CACHE=1 NODE_ENV=test CONFIG=$(pwd)/webpack/index.js nyc ava test/*.js --verbose",
"lint": "make lint",
"test": "make test",
"build": "NODE_ENV=production webpack --config webpack/index.js",
"clean-static": "sh scripts/clean-static.sh",
"build-docs-static": "sh scripts/build-docs-static.sh"

File diff suppressed because it is too large Load Diff

126
yarn.lock
View File

@ -1,9 +1,35 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"
buffer-shims@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
ci-info@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
duplexer@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
esprima@^2.6.0:
version "2.7.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
events-to-array@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/events-to-array/-/events-to-array-1.0.2.tgz#b3484465534fe4ff66fbdd1a83b777713ba404aa"
husky:
version "0.11.9"
resolved "https://registry.yarnpkg.com/husky/-/husky-0.11.9.tgz#28cd1dc16bffdca1d4d93592814e5f3c327b38ee"
@ -11,13 +37,113 @@ husky:
is-ci "^1.0.9"
normalize-path "^1.0.0"
inherits@~2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
is-ci@^1.0.9:
version "1.0.10"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e"
dependencies:
ci-info "^1.0.0"
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
js-yaml@^3.2.7:
version "3.6.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30"
dependencies:
argparse "^1.0.7"
esprima "^2.6.0"
lodash@^3.5.0:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
minimist@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
normalize-path@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379"
process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
readable-stream@^2:
version "2.1.5"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
dependencies:
buffer-shims "^1.0.0"
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
string_decoder "~0.10.x"
util-deprecate "~1.0.1"
readable-stream@~2.0.0:
version "2.0.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
string_decoder "~0.10.x"
util-deprecate "~1.0.1"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
string_decoder@~0.10.x:
version "0.10.31"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
tap-parser@~1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-1.2.2.tgz#5e2f6970611f079c7cf857de1dc7aa1b480de7a5"
dependencies:
events-to-array "^1.0.1"
inherits "~2.0.1"
js-yaml "^3.2.7"
optionalDependencies:
readable-stream "^2"
tap-xunit:
version "1.4.0"
resolved "https://registry.yarnpkg.com/tap-xunit/-/tap-xunit-1.4.0.tgz#f7c49221905914f100c5ca1463e734e8f1116d93"
dependencies:
duplexer "~0.1.1"
minimist "~1.2.0"
tap-parser "~1.2.2"
through2 "~2.0.0"
xmlbuilder "~4.1.0"
xtend "~4.0.0"
through2@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9"
dependencies:
readable-stream "~2.0.0"
xtend "~4.0.0"
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
xmlbuilder@~4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-4.1.0.tgz#687e84d9c4145af8db438d8bec88805df66249f4"
dependencies:
lodash "^3.5.0"
xtend@~4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"