diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b0bbd260..6d15c32c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -19,7 +19,7 @@ jobs: node-version: - 12 # to be removed 2022-04-30 - 14 # to be removed 2023-04-30 - - 15 # to be removed 2021-06-01 + - 16 # to be removed 2024-04-30 # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/Makefile b/Makefile deleted file mode 100644 index dfa5794c..00000000 --- a/Makefile +++ /dev/null @@ -1,117 +0,0 @@ - -NODE_MAJOR_VERSION := $(firstword $(subst ., ,$(shell node --version))) - -ifeq ($(NODE_MAJOR_VERSION),v8) -TESTS = test/*.js -else ifeq ($(NODE_MAJOR_VERSION),v10) -TESTS = test/*.js -else ifeq ($(NODE_MAJOR_VERSION),v12) -TESTS = test/*.js -else -TESTS = test/*.js test/*.mjs -endif - -REPORTER = dot - -# -# Browser Build -# - -all: chai.js - -chai.js: node_modules lib/* - @printf "==> [Browser :: build]\n" - @./node_modules/.bin/browserify \ - --bare \ - --outfile chai.js \ - --standalone chai \ - --entry index.js - -# -# Release Task -# - -define release - ./node_modules/.bin/bump -y --$(1) package.json lib/chai.js - make chai.js - git add --force chai.js lib/chai.js package.json bower.json - npm ls --depth=-1 --long . --loglevel silent | head -1 | git commit -F- -endef - -release-patch: - @$(call release,patch) - -release-minor: - @$(call release,minor) - -release-major: - @$(call release,major) - -# -# Node Module -# - -node_modules: package.json - @npm install - -# -# Tests -# - -test: test-node test-chrome - -test-node: node_modules - @printf "==> [Test :: Node.js]\n" - @NODE_ENV=test ./node_modules/.bin/mocha \ - --require ./test/bootstrap \ - --reporter $(REPORTER) \ - $(TESTS) - -test-cov: node_modules - @NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \ - --require ./test/bootstrap \ - $(TESTS) \ - -test-chrome: clean-browser chai.js - @printf "==> [Test :: Karma (chrome)]\n" - @./node_modules/karma/bin/karma start \ - --single-run --browsers HeadlessChrome - -test-firefox: clean-browser chai.js - @printf "==> [Test :: Karma (Firefox)]\n" - @./node_modules/karma/bin/karma start \ - --browsers Firefox - -test-sauce: clean-browser chai.js - @printf "==> [Test :: Karma (Sauce)]\n" - @CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \ - --single-run - -test-travisci: - @echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID) - @make test-cov - @make test-sauce - -# -# Clean up -# - -clean: clean-node clean-browser clean-cov - -clean-node: - @rm -rf node_modules - -clean-browser: - @rm -f chai.js - -clean-cov: - @rm -rf coverage - -# -# Instructions -# - -.PHONY: all -.PHONY: test test-all test-node test-chrome test-sauce test-cov -.PHONY: clean clean-node clean-browser clean-cov -.PHONY: release-patch release-minor release-major diff --git a/package.json b/package.json index 9a68d88a..9d1fe6a7 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,15 @@ "./": "./" }, "scripts": { - "test": "make test" + "prebuild": "npm run clean", + "build": "browserify --bare --outfile chai.js --standalone chai --entry index.js", + "pretest": "npm run build", + "test": "npm run test-node && npm run test-chrome", + "test-node": "mocha --require ./test/bootstrap/index.js --reporter dot test/*.js test/*.mjs", + "test-chrome": "karma start karma.conf.js --single-run --browsers HeadlessChrome", + "test-firefox": "karma start karma.conf.js --browsers Firefox", + "test-cov": "istanbul cover ./node_modules/.bin/_mocha -- --require ./test/bootstrap/index.js test/*.js test/*.mjs", + "clean": "rm -f chai.js coverage" }, "engines": { "node": ">=12"