From a7b5622e4d572b9c5b6819d79149968fd08ade22 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Sat, 7 May 2022 22:46:10 +0800 Subject: [PATCH] refine dependencies & test cases --- .gitignore | 1 + Makefile | 31 ------------------- package.json | 8 +++-- test/{test.partials.js => partials.test.js} | 2 +- ...est.views-array.js => views-array.test.js} | 2 +- 5 files changed, 8 insertions(+), 36 deletions(-) delete mode 100644 Makefile rename test/{test.partials.js => partials.test.js} (99%) rename test/{test.views-array.js => views-array.test.js} (98%) diff --git a/.gitignore b/.gitignore index af388fa..d67052e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules npm-debug.log .idea/ coverage +.nyc_output/ \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 335addc..0000000 --- a/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -TESTS = test/*.js -REPORTER = spec -TIMEOUT = 20000 -PATH := ./node_modules/.bin:$(PATH) -MOCHA = ./node_modules/mocha/bin/_mocha -COVERALLS = ./node_modules/coveralls/bin/coveralls.js - -clean: - @rm -rf node_modules - -test: - @mocha -r should -R $(REPORTER) -t $(TIMEOUT) \ - $(MOCHA_OPTS) \ - $(TESTS) - -test-debug: - @mocha --debug-brk -r should -R $(REPORTER) -t $(TIMEOUT) \ - $(MOCHA_OPTS) \ - $(TESTS) - -test-cov: - @istanbul cover --report html $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS) - -test-coveralls: - @istanbul cover --report lcovonly $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS) - @echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID) - @cat ./coverage/lcov.info | coveralls && rm -rf ./coverage - -test-all: test test-coveralls - -.PHONY: test diff --git a/package.json b/package.json index 9cacbf5..5aee478 100644 --- a/package.json +++ b/package.json @@ -23,17 +23,19 @@ "coveralls": "*", "eslint": "^3.11.1", "express": "^4.10.0", - "istanbul": "*", "methods": "*", "mocha": "*", "mocha-lcov-reporter": "*", + "nyc": "^15.1.0", "should": "~3.0.0", "supertest": "^2.0.1", "travis-cov": "*" }, "scripts": { - "test": "make test", - "lint": "eslint --fix lib test" + "lint": "eslint --fix lib test", + "test": "mocha --inline-diffs -b -R spec test/*.test.js", + "test-cov": "nyc -r=html -r=text -r=lcov npm run test", + "ci": "npm run lint && npm run test-cov && codecov" }, "bugs": { "url": "https://github.com/JacksonTian/ejs-mate/issues" diff --git a/test/test.partials.js b/test/partials.test.js similarity index 99% rename from test/test.partials.js rename to test/partials.test.js index dc8fd33..cd297f0 100644 --- a/test/test.partials.js +++ b/test/partials.test.js @@ -2,7 +2,7 @@ const express = require('express'); const request = require('supertest'); -const engine = require('../'); +const engine = require('../lib'); var app = express(); app.set('views', __dirname + '/fixtures'); diff --git a/test/test.views-array.js b/test/views-array.test.js similarity index 98% rename from test/test.views-array.js rename to test/views-array.test.js index 8173c4e..35aee2b 100644 --- a/test/test.views-array.js +++ b/test/views-array.test.js @@ -2,7 +2,7 @@ const express = require('express'); const request = require('supertest'); -const engine = require('../'); +const engine = require('../lib'); var app = express(); app.set('views',[__dirname + '/fixtures', __dirname + '/fixtures/thing']);