From fbc40235c66a43336107a5e2c0a500eee2820326 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Fri, 26 Jul 2019 13:57:01 -0400 Subject: [PATCH] update a lot of things --- .prettierrc | 4 ++ .travis.yml | 2 +- index.js | 55 ++++++++------- package-lock.json | 151 ++++++++++++++++-------------------------- package.json | 31 ++++----- readme.md | 20 +++--- test/index.js | 73 ++++++++++++++++++++ test/mocha.opts | 4 -- test/support/index.js | 6 -- test/test.coffee | 42 ------------ 10 files changed, 183 insertions(+), 205 deletions(-) create mode 100644 .prettierrc create mode 100644 test/index.js delete mode 100644 test/mocha.opts delete mode 100644 test/support/index.js delete mode 100644 test/test.coffee diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b2095be --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/.travis.yml b/.travis.yml index 05fb7b7..0421016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js sudo: false node_js: - - 6 + - lts - node after_script: - npm run coveralls diff --git a/index.js b/index.js index 3a9d34f..af72c26 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ -var ap = require('autoprefixer'), - postcss = require('postcss'), - map = require('multi-stage-sourcemap'), - path = require('path'); +const autoprefixer = require('autoprefixer') +const postcss = require('postcss') +const map = require('multi-stage-sourcemap') +const path = require('path') /** * Returns a stylus function that autoprefixes css. @@ -15,55 +15,52 @@ var ap = require('autoprefixer'), * @return {Function} - stylus plugin function */ -module.exports = function(opts) { - if (!opts) { opts = {}; } - +module.exports = function(opts = {}) { // pull `hideWarnings` out so we can pass opts to autoprefixer - var showWarnings = !opts.hideWarnings; - delete opts.hideWarnings; - - return function(style){ - style = this || style; - var filename = style.options.filename; + const showWarnings = !opts.hideWarnings + delete opts.hideWarnings - style.on('end', function(err, css){ + return function(style) { + style = this || style + const filename = style.options.filename + style.on('end', function(err, css) { + if (err) throw new Error(err) // configure the options to be passed to autoprefixer - var process_opts = { + const processOpts = { from: filename, - to: path.join( - path.dirname(filename), - path.basename(filename, path.extname(filename)) - ) + '.css' + to: + path.join( + path.dirname(filename), + path.basename(filename, path.extname(filename)) + ) + '.css' } // if there is a stylus sourcemap, ensure autoprefixer also generates one if (style.sourcemap) { - process_opts.map = { annotation: false } + processOpts.map = { annotation: false } } // run autoprefixer - var res = postcss([ap(opts)]).process(css, process_opts); + var res = postcss([autoprefixer(opts)]).process(css, processOpts) // if sourcemaps are generated, combine the two if (res.map && style.sourcemap) { - var combined_map = map.transfer({ + var combinedMap = map.transfer({ fromSourceMap: res.map.toString(), toSourceMap: style.sourcemap - }); + }) // then set the combined result as the new sourcemap - style.sourcemap = JSON.parse(combined_map); + style.sourcemap = JSON.parse(combinedMap) } if (showWarnings) { - res.warnings().forEach(console.error); + res.warnings().forEach(console.error) } // return the css output - return res.css; - }); - + return res.css + }) } - } diff --git a/package-lock.json b/package-lock.json index 3d6b878..85770ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -120,9 +120,9 @@ } }, "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -214,16 +214,17 @@ "dev": true }, "autoprefixer": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.5.1.tgz", - "integrity": "sha512-KJSzkStUl3wP0D5sdMlP82Q52JLy5+atf2MHAre48+ckWkXgixmfHyWmA77wFDy6jTHU6mIgXv6hAQ2mf1PjJQ==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.1.tgz", + "integrity": "sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw==", "requires": { - "browserslist": "^4.5.4", - "caniuse-lite": "^1.0.30000957", + "browserslist": "^4.6.3", + "caniuse-lite": "^1.0.30000980", + "chalk": "^2.4.2", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", - "postcss": "^7.0.14", - "postcss-value-parser": "^3.3.1" + "postcss": "^7.0.17", + "postcss-value-parser": "^4.0.0" } }, "aws-sign2": { @@ -270,13 +271,13 @@ "dev": true }, "browserslist": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.0.tgz", - "integrity": "sha512-Jk0YFwXBuMOOol8n6FhgkDzn3mY9PYLYGk29zybF05SbRTsMgPqmTNeQQhOghCxq5oFqAXE3u4sYddr4C0uRhg==", + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.6.tgz", + "integrity": "sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA==", "requires": { - "caniuse-lite": "^1.0.30000967", - "electron-to-chromium": "^1.3.133", - "node-releases": "^1.1.19" + "caniuse-lite": "^1.0.30000984", + "electron-to-chromium": "^1.3.191", + "node-releases": "^1.1.25" } }, "caching-transform": { @@ -298,9 +299,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30000971", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000971.tgz", - "integrity": "sha512-TQFYFhRS0O5rdsmSbF1Wn+16latXYsQJat66f7S7lizXW1PVpWJeZw9wqqVLIjuxDRz7s7xRUj13QCfd8hKn6g==" + "version": "1.0.30000985", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000985.tgz", + "integrity": "sha512-1ngiwkgqAYPG0JSSUp3PUDGPKKY59EK7NrGGX+VOxaKCNzRbNc7uXMny+c3VJfZxtoK3wSImTvG9T9sXiTw2+w==" }, "caseless": { "version": "0.12.0", @@ -428,35 +429,17 @@ "dev": true }, "coveralls": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.3.tgz", - "integrity": "sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.5.tgz", + "integrity": "sha512-/KD7PGfZv/tjKB6LoW97jzIgFqem0Tu9tZL9/iwBnBd8zkIZp7vT1ZSHNvnr0GSQMV/LTMxUstWg8WcDDUVQKg==", "dev": true, "requires": { "growl": "~> 1.10.0", - "js-yaml": "^3.11.0", + "js-yaml": "^3.13.1", "lcov-parse": "^0.0.10", "log-driver": "^1.2.7", "minimist": "^1.2.0", "request": "^2.86.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - } } }, "cp-file": { @@ -586,9 +569,9 @@ } }, "electron-to-chromium": { - "version": "1.3.137", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.137.tgz", - "integrity": "sha512-kGi32g42a8vS/WnYE7ELJyejRT7hbr3UeOOu0WeuYuQ29gCpg9Lrf6RdcTQVXSt/v0bjCfnlb/EWOOsiKpTmkw==" + "version": "1.3.200", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.200.tgz", + "integrity": "sha512-PUurrpyDA74MuAjJRD+79ss5BqJlU3mdArRbuu4wO/dt6jc3Ic/6BDmFJxkdwbfq39cHf/XKm2vW98XSvut9Dg==" }, "emoji-regex": { "version": "7.0.3", @@ -805,6 +788,20 @@ "assert-plus": "^1.0.0" } }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -1321,9 +1318,9 @@ } }, "mocha": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", - "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -1360,42 +1357,6 @@ "ms": "^2.1.1" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -1460,9 +1421,9 @@ } }, "node-releases": { - "version": "1.1.21", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.21.tgz", - "integrity": "sha512-TwnURTCjc8a+ElJUjmDqU6+12jhli1Q61xOQmdZ7ECZVBZuQpN/1UnembiIHDM1wCcfLvh5wrWXUF5H6ufX64Q==", + "version": "1.1.26", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.26.tgz", + "integrity": "sha512-fZPsuhhUHMTlfkhDLGtfY80DSJTjOcx+qD1j5pqPkuhUHVS7xHZIg9EE4DHK8O3f0zTxXHX5VIkDG8pu98/wfQ==", "requires": { "semver": "^5.3.0" } @@ -1781,9 +1742,9 @@ } }, "postcss": { - "version": "7.0.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.16.tgz", - "integrity": "sha512-MOo8zNSlIqh22Uaa3drkdIAgUGEL+AD1ESiSdmElLUmE2uVDo1QloiT/IfW9qRw8Gw+Y/w69UVMGwbufMSftxA==", + "version": "7.0.17", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz", + "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -1791,9 +1752,9 @@ } }, "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz", + "integrity": "sha512-ESPktioptiSUchCKgggAkzdmkgzKfmp0EU8jXH+5kbIUB+unr0Y4CY9SRMvibuvYUBjNh1ACLbxqYNpdTQOteQ==" }, "pseudomap": { "version": "1.0.2", @@ -1802,9 +1763,9 @@ "dev": true }, "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", + "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==", "dev": true }, "pump": { diff --git a/package.json b/package.json index 7c8d35e..4a3f92c 100644 --- a/package.json +++ b/package.json @@ -2,34 +2,31 @@ "name": "autoprefixer-stylus", "description": "autoprefixer for stylus", "version": "0.14.0", - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/jescalan/autoprefixer-stylus.git" + "author": "Jeff Escalante", + "dependencies": { + "autoprefixer": "9.6.1", + "multi-stage-sourcemap": "0.3.1", + "postcss": "7.0.17" }, "devDependencies": { "chai": "4.2.0", "coffeescript": "^2.4.1", - "coveralls": "3.0.3", + "coveralls": "3.0.5", "css-parse": "2.0.0", - "mocha": "6.1.4", + "mocha": "6.2.0", "nyc": "^14.1.1", "rimraf": "^2.6.3", "stylus": "0.54.5" }, - "author": "Jeff Escalante", - "main": "index.js", - "scripts": { - "test": "nyc mocha", - "coveralls": "nyc report --reporter=text-lcov | coveralls && rimraf ./coverage", - "coverage": "nyc report --reporter=html && open coverage/index.html" - }, "engines": { "node": ">= 4" }, - "dependencies": { - "autoprefixer": "9.5.1", - "multi-stage-sourcemap": "0.3.1", - "postcss": "7.0.16" + "license": "MIT", + "main": "index.js", + "repository": "https://github.com/jescalan/autoprefixer-stylus", + "scripts": { + "coverage": "nyc report --reporter=html && open coverage/index.html", + "coveralls": "nyc report --reporter=text-lcov | coveralls && rimraf ./coverage", + "test": "nyc mocha" } } diff --git a/readme.md b/readme.md index 150a322..f155fab 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,4 @@ -Autoprefixer Stylus -------------------- +## Autoprefixer Stylus An [autoprefixer](https://github.com/postcss/autoprefixer) plugin for stylus. @@ -17,28 +16,27 @@ You can install through npm as such: `npm install autoprefixer-stylus` You can include autoprefixer-stylus as a normal stylus plugin. Basic example below: ```js -var stylus = require('stylus'); -var autoprefixer = require('autoprefixer-stylus'); +const stylus = require('stylus') +const autoprefixer = require('autoprefixer-stylus') stylus(css) .use(autoprefixer()) - .render(function(err, output){ - console.log(output); - }); + .render(function(err, output) { + console.log(output) + }) ``` -This plugin also takes any of the [options that autoprefixer normally takes](), which at the time of writing is `browsers` and `cascade`. Example with `browsers` below: +This plugin also takes any of the [options that autoprefixer normally takes](https://github.com/postcss/autoprefixer#options). Example with `overrideBrowswerslist` below: ```js -stylus(css) - .use(autoprefixer({ browsers: ['ie 7', 'ie 8'] })); +stylus(css).use(autoprefixer({ overrideBrowserslist: ['ie 7', 'ie 8'] })) ``` By default, this plugin will display any warnings. You can disable this with the `hideWarnings` option. Example below: ```js stylus(css) - .use(autoprefixer({hideWarnings: true}); + .use(autoprefixer({ hideWarnings: true }); ``` If you'd like to install globally and run from the command line, you can do it like this: diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..358c232 --- /dev/null +++ b/test/index.js @@ -0,0 +1,73 @@ +const autoprefixer = require('../') +const chai = require('chai') +const parse = require('css-parse') +const fs = require('fs') +const path = require('path') +const stylus = require('stylus') + +const test_path = path.join(__dirname, 'fixtures') +chai.should() + +const match_expected = (file, args, done) => { + stylus(fs.readFileSync(path.join(test_path, file), 'utf8')) + .use(autoprefixer(args)) + .render((err, css) => { + if (err) return done(err) + + const expected = fs.readFileSync( + path.join(test_path, file.replace('.styl', '.css')), + 'utf8' + ) + + parse(css).should.eql(parse(expected)) + + done() + }) +} + +describe('basic', function() { + it('works', function(done) { + match_expected('basic.styl', {}, done) + }) + + it("doesn't bail when given whack arguments", function(done) { + match_expected('basic.styl', { foo: 'bar' }, done) + }) + + it('takes browser options', function(done) { + match_expected( + 'browser.styl', + { + overrideBrowserslist: ['last 1 versions'], + grid: true + }, + done + ) + }) + + it('returns correct sourcemaps', function(done) { + const filename = path.join(test_path, 'basic.styl') + + const style = stylus(fs.readFileSync(filename, 'utf8')) + .set('sourcemap', true) + .set('filename', filename) + .use(autoprefixer()) + + style.render(err => { + if (err) return done(err) + + style.sourcemap.should.be.an('object') + style.sourcemap.sources[0].should.equal('stylus') + style.sourcemap.version.should.equal(3) + style.sourcemap.mappings.should.equal( + 'AAAA;EACE,wBAAY;KAAZ,qBAAY;UAAZ,gBAAY' + ) + + done() + }) + }) + + it('hideWarnings option works', function(done) { + match_expected('basic.styl', { hideWarnings: true }, done) + }) +}) diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 4aa437b..0000000 --- a/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---reporter spec ---require coffeescript/register ---require test/support -"./test/*.{js,coffee}" diff --git a/test/support/index.js b/test/support/index.js deleted file mode 100644 index fccaade..0000000 --- a/test/support/index.js +++ /dev/null @@ -1,6 +0,0 @@ -var chai = require('chai'), - autoprefixer = require('../../') - should = chai.should(); - -global.autoprefixer = autoprefixer; -global.should = should; diff --git a/test/test.coffee b/test/test.coffee deleted file mode 100644 index 3130a9f..0000000 --- a/test/test.coffee +++ /dev/null @@ -1,42 +0,0 @@ -fs = require 'fs' -path = require 'path' -stylus = require 'stylus' -parse = require 'css-parse' -test_path = path.join(__dirname, 'fixtures') - -match_expected = (file, args, done) -> - stylus(fs.readFileSync(path.join(test_path, file), 'utf8')) - .use(autoprefixer(args)) - .render (err, css) -> - if err then return done(err) - expected = fs.readFileSync(path.join(test_path, file.replace('.styl', '.css')), 'utf8') - - parse(css).should.eql(parse(expected)) - done() - -describe 'basic', -> - - it "works", (done) -> - match_expected('basic.styl', null, done) - - it "doesn't bail when given whack arguments", (done) -> - match_expected('basic.styl', { foo: 'bar' }, done) - - it "takes browser options", (done) -> - match_expected('browser.styl', { browsers: ['ie 7', 'ie 8'] }, done) - - it "returns correct sourcemaps", (done) -> - filename = path.join(test_path, 'basic.styl') - - style = stylus(fs.readFileSync(filename, 'utf8')) - .set('sourcemap', true) - .set('filename', filename) - .use(autoprefixer()) - - style.render (err, css) -> - if err then return done(err) - style.sourcemap.should.be.an('object') - style.sourcemap.sources[0].should.equal('stylus') - style.sourcemap.version.should.equal(3) - style.sourcemap.mappings.should.equal('AAAA;EACE,wBAAY;KAAZ,qBAAY;UAAZ,gBAAY') - done()