diff --git a/.gitignore b/.gitignore index 5c49d4c..f6d83d4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ coverage/ tmp/ npm-debug.log* .DS_Store +.nyc_output/ diff --git a/.travis.yml b/.travis.yml index eb5b6c6..d3e8bac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,18 @@ -node_js: - - stable - - 9 - - 6 - - 4 -sudo: false +os: linux +dist: bionic language: node_js +node_js: + - 12 + - 10 + - 8 script: "npm run test:cov" -after_script: "npm i -g codecov.io && cat ./coverage/lcov.info | codecov" + +jobs: + include: + - node_js: stable + after_script: | + npm i -g codecov + npx nyc report --reporter=text-lcov | codecov --pipe + # Node.js 6 is not supported by nyc, so run tests without code coverage + - node_js: 6 + script: npm run test diff --git a/index.js b/index.js index 289f646..473099b 100644 --- a/index.js +++ b/index.js @@ -16,8 +16,8 @@ function cssExtract (bundle, opts) { var outFile = opts.out || opts.o || 'bundle.css' var sourceMap = d(opts.sourceMap, bundle && bundle._options && bundle._options.debug, false) - assert.equal(typeof bundle, 'object', 'bundle should be an object') - assert.equal(typeof opts, 'object', 'opts should be an object') + assert.strictEqual(typeof bundle, 'object', 'bundle should be an object') + assert.strictEqual(typeof opts, 'object', 'opts should be an object') // every time .bundle is called, attach hook bundle.on('reset', addHooks) diff --git a/package.json b/package.json index c142119..fb44f81 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "deps": "dependency-check . && dependency-check . --extra --no-dev", "test": "standard && npm run deps && NODE_ENV=test node test", - "test:cov": "standard && npm run deps && NODE_ENV=test istanbul cover ./test/index.js" + "test:cov": "standard && npm run deps && NODE_ENV=test nyc node test" }, "repository": "stackcss/css-extract", "keywords": [ @@ -20,21 +20,21 @@ ], "license": "MIT", "dependencies": { - "bl": "^1.1.2", + "bl": "^4.0.2", "defined": "^1.0.0", "from2-string": "^1.1.0", "static-module": "^3.0.0", - "through2": "^2.0.1" + "through2": "^4.0.2" }, "devDependencies": { - "browserify": "^13.0.0", - "dependency-check": "^2.5.1", + "browserify": "^16.5.2", + "dependency-check": "^2.10.1", "insert-css": "^2.0.0", - "istanbul": "^0.4.2", - "sheetify": "^6.0.0", - "standard": "^6.0.7", - "tape": "^4.5.0", - "tmp": "0.0.28" + "nyc": "^15.1.0", + "sheetify": "^8.0.0", + "standard": "^14.3.4", + "tape": "^5.0.1", + "tmp": "^0.2.1" }, "files": [ "index.js", diff --git a/test/index.js b/test/index.js index 1afa789..bb788d8 100644 --- a/test/index.js +++ b/test/index.js @@ -33,7 +33,7 @@ test('css-extract', function (t) { t.test('should extract sheetify css to file', function (t) { t.plan(3) - tmpDir({unsafeCleanup: true}, onDir) + tmpDir({ unsafeCleanup: true }, onDir) function onDir (err, dir, cleanup) { t.ifError(err, 'no error')