pax_global_header00006660000000000000000000000064130502115260014505gustar00rootroot0000000000000052 comment=649b9542e1f24ffeea55d4e45607b18daf0ae00d postcss-load-options-1.2.0/000077500000000000000000000000001305021152600156115ustar00rootroot00000000000000postcss-load-options-1.2.0/.editorconfig000066400000000000000000000002741305021152600202710ustar00rootroot00000000000000root = true [*] charset = utf-8 indent_size = 2 end_of_line = lf indent_style = space trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false postcss-load-options-1.2.0/.github/000077500000000000000000000000001305021152600171515ustar00rootroot00000000000000postcss-load-options-1.2.0/.github/ISSUE_TEMPLATE.md000066400000000000000000000022251305021152600216570ustar00rootroot00000000000000## Problem Briefly describe the issue you are experiencing (or the feature you want to see added to the plugin). Tell us what you were trying to do and what happened instead. Remember, this is _not_ a place to ask questions. For that, go to http://gitter.im/postcss/postcss ## Details Describe in more detail the problem you have been experiencing, if necessary. ## Error Logs Create a [gist](https://gist.github.com) which is a paste of your **full** logs(_result.warnings_ (PostCSS Warnings), _result.messages_ (PostCSS Messages), _result.css_ (CSS)), and link them here. Do **not** paste your full logs here, as it will make this issue long and hard to read! If you are reporting a bug, **always** include logs! ## Issue [ Code ] Please remember that, with sample code; it's easier to reproduce bug and much faster to fix it. Please refer to a simple code example. ```bash $ git clone https://github.com// ``` ## Environment Please provide information about your environment. | OS | Node | npm | PostCSS | |:---------------:|:---------:|:---------:|:---------:| | [name][version] | [version] | [version] | [version] | postcss-load-options-1.2.0/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000024271305021152600227570ustar00rootroot00000000000000## Proposed changes Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. ## Types of changes What types of changes does your code introduce _Put an `x` in the boxes that apply_ - [ ] Bug (non-breaking change which fixes an issue) - [ ] Feature (non-breaking change which adds functionality) - [ ] Breaking Change (fix or feature which changes existing functionality) ## Checklist _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is a reminder of what we are going to look for before merging your code._ - [ ] I have read the [CONTRIBUTING](/CONTRIBUTING.md) guide - [ ] Lint and unit tests pass with my changes - [ ] I have added tests that prove my fix is effective/works - [ ] I have added necessary documentation (if appropriate) - [ ] Any dependent changes are merged and published in downstream modules ## Further comments If this is a large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... ### Reviewers: @michael-ciniawsky, ... postcss-load-options-1.2.0/.gitignore000066400000000000000000000001371305021152600176020ustar00rootroot00000000000000# OS .DS_Store ._* # NODEJS .nyc_output npm-debug.log dmd coverage jsdoc-api node_modules postcss-load-options-1.2.0/.npmignore000066400000000000000000000002131305021152600176040ustar00rootroot00000000000000# FILES .travis.yml .gitignore .editorconfig npm-debug.log # DIRECTORIES .github .nyc_output dmd test coverage jsdoc-api node_modules postcss-load-options-1.2.0/.travis.yml000066400000000000000000000003421305021152600177210ustar00rootroot00000000000000language: node_js node_js: - node - 6 - 4 cache: directories: - node_modules after_success: - './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls' notifications: email: false postcss-load-options-1.2.0/CHANGELOG.md000066400000000000000000000010331305021152600174170ustar00rootroot00000000000000 # [1.2.0](https://github.com/michael-ciniawsky/postcss-load-options/compare/v1.1.0...v1.2.0) (2017-02-13) ### Features * **index:** allow file extensions for .postcssrc ([fc15720](https://github.com/michael-ciniawsky/postcss-load-options/commit/fc15720)) # [1.1.0](https://github.com/michael-ciniawsky/postcss-load-options/compare/v1.0.2...v1.1.0) (2017-01-07) ### Features * **index:** config file ([d8349b7](https://github.com/michael-ciniawsky/postcss-load-options/commit/d8349b7)) postcss-load-options-1.2.0/INDEX.md000066400000000000000000000021221305021152600167770ustar00rootroot00000000000000## Functions
optionsrc(ctx, path, options)Object

Autoload Options for PostCSS

options(options)Object
## optionsrc(ctx, path, options) ⇒ Object Autoload Options for PostCSS **Kind**: global function **Returns**: Object - options PostCSS Options **Requires**: module:cosmiconfig, module:object-assign, module:lib/options **Version**: 1.2.0 **Author:** Michael Ciniawsky (@michael-ciniawsky) | Param | Type | Description | | --- | --- | --- | | ctx | Object | Context | | path | String | Directory | | options | Object | Options | ## options(options) ⇒ Object **Kind**: global function **Returns**: Object - options PostCSS Options | Param | Type | Description | | --- | --- | --- | | options | Object | PostCSS Config | postcss-load-options-1.2.0/LICENSE000066400000000000000000000021221305021152600166130ustar00rootroot00000000000000License (MIT) Copyright (c) 2016 Michael Ciniawsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. postcss-load-options-1.2.0/README.md000066400000000000000000000102611305021152600170700ustar00rootroot00000000000000[![npm][npm]][npm-url] [![node][node]][node-url] [![deps][deps]][deps-url] [![tests][tests]][tests-url] [![coverage][cover]][cover-url] [![code style][style]][style-url] [![chat][chat]][chat-url]

Load Options

Install

```bash npm i -D postcss-load-options ```

Usage

### `package.json` Create **`postcss`** section in your projects **`package.json`**. ``` App |– client |– public | |- package.json ``` ```json { "dependencies": { "sugarss": "0.2.0" }, "postcss": { "parser": "sugarss", "map": false, "from": "path/to/src/file.css", "to": "path/to/dest/file.css" } } ``` ### `.postcssrc` Create a **`.postcssrc`** file. ``` App |– client |– public | |- (.postcssrc|.postcssrc.json|.postcssrc.yaml) |- package.json ``` **`JSON`** ```json { "parser": "sugarss", "map": false, "from": "path/to/src/file.css", "to": "path/to/dest/file.css" } ``` **`YAML`** ```yaml parser: sugarss map: false from: "/path/to/src.sss" to: "/path/to/dest.css" ``` ### `postcss.config.js` or `.postcssrc.js` You may need some JavaScript logic to generate your config. For this case you can use a file named **`postcss.config.js`** or **`.postcssrc.js`**. ``` App |– client |– public | |- (postcss.config.js|.postcssrc.js) |- package.json ``` ```js module.exports = (ctx) => { return { parser: ctx.sugar ? 'sugarss' : false, map: ctx.env === 'development' ? ctx.map || false, from: 'path/to/src/file.css', to: 'path/to/dest/file.css' } } ```

Options

**`parser`**: ```js 'parser': 'sugarss' ``` **`syntax`**: ```js 'syntax': 'postcss-scss' ``` **`stringifier`**: ```js 'stringifier': 'midas' ``` [**`map`**:](https://github.com/postcss/postcss/blob/master/docs/source-maps.md) ```js 'map': 'inline' ``` **`from`**: ```js from: 'path/to/dest/file.css' ``` **`to`**: ```js to: 'path/to/dest/file.css' ``` ### Context When using a function `(postcss.config.js)`, it is possible to pass context to `postcss-load-options`, which will be evaluated before loading your options. By default `ctx.env (process.env.NODE_ENV)` and `ctx.cwd (process.cwd())` are available.

Example

### ```js const { readFileSync } = require('fs') const postcss = require('postcss') const optionsrc = require('postcss-load-options') const sss = readFileSync('index.sss', 'utf8') const ctx = { sugar: true, map: 'inline' } optionsrc(ctx).then((options) => { postcss() .process(sss, options) .then(({ css }) => console.log(css)) })) ```

Maintainers


Michael Ciniawsky
[npm]: https://img.shields.io/npm/v/postcss-load-options.svg [npm-url]: https://npmjs.com/package/postcss-load-options [node]: https://img.shields.io/node/v/postcss-load-options.svg [node-url]: https://nodejs.org/ [deps]: https://david-dm.org/michael-ciniawsky/postcss-load-options.svg [deps-url]: https://david-dm.org/michael-ciniawsky/postcss-load-options [tests]: http://img.shields.io/travis/michael-ciniawsky/postcss-load-options.svg [tests-url]: https://travis-ci.org/michael-ciniawsky/postcss-load-options [cover]: https://coveralls.io/repos/github/michael-ciniawsky/postcss-load-options/badge.svg [cover-url]: https://coveralls.io/github/michael-ciniawsky/postcss-load-options [style]: https://img.shields.io/badge/code%20style-standard-yellow.svg [style-url]: http://standardjs.com/ [chat]: https://img.shields.io/gitter/room/postcss/postcss.svg [chat-url]: https://gitter.im/postcss/postcss postcss-load-options-1.2.0/index.js000066400000000000000000000030571305021152600172630ustar00rootroot00000000000000// ------------------------------------ // #POSTCSS - LOAD OPTIONS // ------------------------------------ 'use strict' var resolve = require('path').resolve var config = require('cosmiconfig') var assign = require('object-assign') var loadOptions = require('./lib/options') /** * @author Michael Ciniawsky (@michael-ciniawsky) * @description Autoload Options for PostCSS * * * @module postcss-load-options * @version 1.2.0 * * @requires cosmiconfig * @requires object-assign * @requires lib/options * * @method optionsrc * * @param {Object} ctx Context * @param {String} path Directory * @param {Object} options Options * @return {Object} options PostCSS Options */ module.exports = function optionsrc (ctx, path, options) { ctx = assign({ cwd: process.cwd(), env: process.env.NODE_ENV }, ctx) path = path ? resolve(path) : process.cwd() options = assign({ rcExtensions: true }, options) if (!ctx.env) process.env.NODE_ENV = 'development' var file return config('postcss', options) .load(path) .then(function (result) { if (!result) console.log('PostCSS Options could not be loaded') file = result ? result.filepath : '' return result ? result.config : {} }) .then(function (options) { if (typeof options === 'function') options = options(ctx) if (typeof options === 'object') options = assign(options, ctx) return options }) .then(function (options) { return { options: loadOptions(options), file: file } }) .catch(console.log) } postcss-load-options-1.2.0/lib/000077500000000000000000000000001305021152600163575ustar00rootroot00000000000000postcss-load-options-1.2.0/lib/options.js000066400000000000000000000013351305021152600204120ustar00rootroot00000000000000// ------------------------------------ // #POSTCSS - LOAD OPTIONS - OPTIONS // ------------------------------------ 'use strict' /** * * @method options * * @param {Object} options PostCSS Config * * @return {Object} options PostCSS Options */ module.exports = function options (options) { if (options.parser && typeof options.parser === 'string') { options.parser = require(options.parser) } if (options.syntax && typeof options.syntax === 'string') { options.syntax = require(options.syntax) } if (options.stringifier && typeof options.stringifier === 'string') { options.stringifier = require(options.stringifier) } if (options.plugins) { delete options.plugins } return options } postcss-load-options-1.2.0/logo.svg000066400000000000000000000116211305021152600172730ustar00rootroot00000000000000 postcss-load-options-1.2.0/package.json000066400000000000000000000026341305021152600201040ustar00rootroot00000000000000{ "name": "postcss-load-options", "version": "1.2.0", "description": "Autoload Options for PostCSS", "engines": { "node": ">=0.12" }, "main": "index.js", "scripts": { "clean": "rm -rf .nyc_output coverage jsdoc-api dmd", "lint": "standard", "test": "nyc ava -v test/pkg/index.js test/rc/index.js test/js/index.js test/err/index.js", "logs": "standard-changelog -i CHANGELOG.md -w", "docs": "jsdoc2md index.js lib/options.js > INDEX.md", "start": "sudo npm run clean && npm run lint && sudo npm test" }, "dependencies": { "cosmiconfig": "^2.1.0", "object-assign": "^4.1.0" }, "devDependencies": { "ava": "^0.18.1", "coveralls": "^2.11.16", "jsdoc-to-markdown": "^3.0.0", "midas": "^2.0.3", "nyc": "^10.1.0", "postcss": "^5.2.12", "postcss-scss": "^0.4.0", "standard": "^8.6.0", "standard-changelog": "0.0.1", "sugarss": "^0.2.0" }, "files": [ "lib", "index.js" ], "keywords": [ "postcss", "postcss-options" ], "author": { "name": "Michael Ciniawky", "email": "michael.ciniawsky@gmail.com" }, "repository": { "type": "git", "url": "https://github.com/michael-ciniawsky/postcss-load-options.git" }, "bugs": { "url": "https://github.com/michael-ciniawsky/postcss-load-options/issues" }, "homepage": "https://github.com/michael-ciniawsky/postcss-load-options#readme", "license": "MIT" } postcss-load-options-1.2.0/test/000077500000000000000000000000001305021152600165705ustar00rootroot00000000000000postcss-load-options-1.2.0/test/err/000077500000000000000000000000001305021152600173605ustar00rootroot00000000000000postcss-load-options-1.2.0/test/err/index.js000066400000000000000000000005451305021152600210310ustar00rootroot00000000000000// ------------------------------------ // #POSTCSS - LOAD OPTIONS - TEST - ERR // ------------------------------------ 'use strict' var test = require('ava') var optionsrc = require('../..') test('No Config - {Error} - Load Options', function (t) { optionsrc().then(function (config) { t.is(config.options, {}) t.is(config.file, '') }) }) postcss-load-options-1.2.0/test/js/000077500000000000000000000000001305021152600172045ustar00rootroot00000000000000postcss-load-options-1.2.0/test/js/expect/000077500000000000000000000000001305021152600204745ustar00rootroot00000000000000postcss-load-options-1.2.0/test/js/expect/index.css000066400000000000000000000007011305021152600223130ustar00rootroot00000000000000.index { color: blue; } /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL2ZpeHR1cmVzL2luZGV4LnNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLFlBQVk7Q0FEUjs7QUFHTjtFQUNFLFdBQVc7Q0FERjs7QUFHWDtFQUNFLGlCQUFpQjtDQURGIiwiZmlsZSI6ImluZGV4LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5pbmRleFxuICBjb2xvcjogYmx1ZTtcblxuLmluZGV4X19yZWRcbiAgY29sb3I6IHJlZDtcblxuLmluZGV4X19nb2xkZW5yb2RcbiAgY29sb3I6IGdvbGRlbnJvZDtcbiJdfQ== */ postcss-load-options-1.2.0/test/js/fixtures/000077500000000000000000000000001305021152600210555ustar00rootroot00000000000000postcss-load-options-1.2.0/test/js/fixtures/index.css000066400000000000000000000000321305021152600226710ustar00rootroot00000000000000.index { color: blue; } postcss-load-options-1.2.0/test/js/fixtures/index.sss000066400000000000000000000000251305021152600227130ustar00rootroot00000000000000.index color: blue postcss-load-options-1.2.0/test/js/index.js000066400000000000000000000027611305021152600206570ustar00rootroot00000000000000// ------------------------------------ // #POSTCSS - LOAD OPTIONS - TEST - JS // ------------------------------------ 'use strict' var test = require('ava') var path = require('path') var read = require('fs').readFileSync var fixture = function (file) { return read(path.join(__dirname, 'fixtures', file)) } var expect = function (file) { return read(path.join(__dirname, 'expect', file)) } var postcss = require('postcss') var optionsrc = require('../..') test('postcss.config.js - {Function} - Load Options', function (t) { var ctx = { map: 'inline' } optionsrc(ctx, 'test/js').then(function (options) { t.is(options.parser, require('sugarss')) t.is(options.syntax, require('postcss-scss')) t.is(options.map, 'inline') t.is(options.from, './test/js/fixtures/index.css') t.is(options.to, './test/js/expect/index.css') t.is(options.file, path.resolve('test/js/postcss.config.js')) }) }) test('postcss.config.js - {Function} - Process SSS', function (t) { optionsrc({}, 'test/js').then(function (options) { postcss([]) .process(fixture('index.sss'), options) .then(function (result) { t.is(expect('index.css'), result.css) }) }) }) test('postcss.config.js - {Function} - Process CSS', function (t) { var ctx = { parser: false } optionsrc(ctx, 'test/js').then(function (options) { postcss([]) .process(fixture('index.css'), options) .then(function (result) { t.is(expect('index.css'), result.css) }) }) }) postcss-load-options-1.2.0/test/js/postcss.config.js000066400000000000000000000004261305021152600225060ustar00rootroot00000000000000module.exports = function (ctx) { return { parser: 'sugarss', syntax: 'postcss-scss', stringifier: 'midas', map: ctx.env === 'development' ? ctx.map : false, from: './test/js/fixtures/index.css', to: './test/js/expect/index.css', plugins: {} } } postcss-load-options-1.2.0/test/pkg/000077500000000000000000000000001305021152600173515ustar00rootroot00000000000000postcss-load-options-1.2.0/test/pkg/expect/000077500000000000000000000000001305021152600206415ustar00rootroot00000000000000postcss-load-options-1.2.0/test/pkg/expect/index.css000066400000000000000000000007011305021152600224600ustar00rootroot00000000000000.index { color: blue; } /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL2ZpeHR1cmVzL2luZGV4LnNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLFlBQVk7Q0FEUjs7QUFHTjtFQUNFLFdBQVc7Q0FERjs7QUFHWDtFQUNFLGlCQUFpQjtDQURGIiwiZmlsZSI6ImluZGV4LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5pbmRleFxuICBjb2xvcjogYmx1ZTtcblxuLmluZGV4X19yZWRcbiAgY29sb3I6IHJlZDtcblxuLmluZGV4X19nb2xkZW5yb2RcbiAgY29sb3I6IGdvbGRlbnJvZDtcbiJdfQ== */ postcss-load-options-1.2.0/test/pkg/fixtures/000077500000000000000000000000001305021152600212225ustar00rootroot00000000000000postcss-load-options-1.2.0/test/pkg/fixtures/index.css000066400000000000000000000000321305021152600230360ustar00rootroot00000000000000.index { color: blue; } postcss-load-options-1.2.0/test/pkg/fixtures/index.sss000066400000000000000000000000251305021152600230600ustar00rootroot00000000000000.index color: blue postcss-load-options-1.2.0/test/pkg/index.js000066400000000000000000000026731305021152600210260ustar00rootroot00000000000000// ------------------------------------ // #POSTCSS - LOAD OPTIONS - TEST - PKG // ------------------------------------ 'use strict' var test = require('ava') var path = require('path') var read = require('fs').readFileSync var fixture = function (file) { return read(path.join(__dirname, 'fixtures', file)) } var expect = function (file) { return read(path.join(__dirname, 'expect', file)) } var postcss = require('postcss') var optionsrc = require('../..') test('package.json - {Object} - Load Options', function (t) { optionsrc({}, 'test/pkg').then(function (options) { t.is(options.parser, require('sugarss')) t.is(options.syntax, require('postcss-scss')) t.is(options.map, false) t.is(options.from, './test/pkg/fixtures/index.css') t.is(options.to, './test/pkg/expect/index.css') t.is(options.file, path.resolve('test/pkg/package.json')) }) }) test('package.json - {Object} - Process SSS', function (t) { optionsrc({}, 'test/pkg').then(function (options) { postcss([]) .process(fixture('index.sss'), options) .then(function (result) { t.is(expect('index.css'), result.css) }) }) }) test('package.json - {Object} - Process CSS', function (t) { var ctx = { parser: false } optionsrc(ctx, 'test/pkg').then(function (options) { postcss([]) .process(fixture('index.css'), options) .then(function (result) { t.is(expect('index.css'), result.css) }) }) }) postcss-load-options-1.2.0/test/pkg/package.json000066400000000000000000000003451305021152600216410ustar00rootroot00000000000000{ "name": "postcss-options", "postcss": { "parser": "sugarss", "syntax": "postcss-scss", "map": false, "from": "./test/pkg/fixtures/index.sss", "to": "./test/pkg/expect/index.css", "plugins": {} } } postcss-load-options-1.2.0/test/rc/000077500000000000000000000000001305021152600171745ustar00rootroot00000000000000postcss-load-options-1.2.0/test/rc/.postcssrc000066400000000000000000000002471305021152600212230ustar00rootroot00000000000000{ "parser": "sugarss", "syntax": "postcss-scss", "map": false, "from": "./test/rc/fixtures/index.css", "to": "./test/rc/expect/index.css", "plugins": {} } postcss-load-options-1.2.0/test/rc/expect/000077500000000000000000000000001305021152600204645ustar00rootroot00000000000000postcss-load-options-1.2.0/test/rc/expect/index.css000066400000000000000000000007011305021152600223030ustar00rootroot00000000000000.index { color: blue; } /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL2ZpeHR1cmVzL2luZGV4LnNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLFlBQVk7Q0FEUjs7QUFHTjtFQUNFLFdBQVc7Q0FERjs7QUFHWDtFQUNFLGlCQUFpQjtDQURGIiwiZmlsZSI6ImluZGV4LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5pbmRleFxuICBjb2xvcjogYmx1ZTtcblxuLmluZGV4X19yZWRcbiAgY29sb3I6IHJlZDtcblxuLmluZGV4X19nb2xkZW5yb2RcbiAgY29sb3I6IGdvbGRlbnJvZDtcbiJdfQ== */ postcss-load-options-1.2.0/test/rc/fixtures/000077500000000000000000000000001305021152600210455ustar00rootroot00000000000000postcss-load-options-1.2.0/test/rc/fixtures/index.css000066400000000000000000000000321305021152600226610ustar00rootroot00000000000000.index { color: blue; } postcss-load-options-1.2.0/test/rc/fixtures/index.sss000066400000000000000000000000251305021152600227030ustar00rootroot00000000000000.index color: blue postcss-load-options-1.2.0/test/rc/index.js000066400000000000000000000026401305021152600206430ustar00rootroot00000000000000// ------------------------------------ // #POSTCSS - LOAD OPTIONS - TEST - RC // ------------------------------------ 'use strict' var test = require('ava') var path = require('path') var read = require('fs').readFileSync var fixture = function (file) { return read(path.join(__dirname, 'fixtures', file)) } var expect = function (file) { return read(path.join(__dirname, 'expect', file)) } var postcss = require('postcss') var optionsrc = require('../..') test('.postcssrc - {Object} - Load Options', function (t) { optionsrc().then(function (options) { t.is(options.parser, require('sugarss')) t.is(options.syntax, require('postcss-scss')) t.is(options.map, false) t.is(options.from, './test/rc/fixtures/index.css') t.is(options.to, './test/rc/expect/index.css') t.is(options.file, path.resolve('test/pkg/.postcssrc')) }) }) test('.postcssrc - {Object} - Process SSS', function (t) { optionsrc({}, 'test/rc').then(function (options) { postcss([]) .process(fixture('index.sss'), options) .then(function (result) { t.is(expect('index.css'), result.css) }) }) }) test('.postcssrc - {Object} - Process CSS', function (t) { var ctx = { parser: false } optionsrc(ctx, 'test/rc').then(function (options) { postcss([]) .process(fixture('index.css'), options) .then(function (result) { t.is(expect('index.css'), result.css) }) }) })