Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit f4d296b

Browse files
committed
Fixed: replacement of postcss-log-warnings (deprecated) by postcss-reporter
Close #162
1 parent b71b7c8 commit f4d296b

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
- Fixed: replacement of `postcss-log-warnings` (deprecated) by `postcss-reporter`
3+
([#162](https://github.com/cssnext/cssnext/issues/162))
4+
15
# 1.7.1 - 2015-06-19
26

37
- Fixed: bullet for browser messages should be visible on Chrome Windows.

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ $ npm test
1414
$ git checkout -b fix.bug423
1515
```
1616

17+
`npm test` will compile what is need to be and run all tests.
18+
If you want to work on one test only, you can run something like
19+
20+
```console
21+
$ babel-tape-runner src/__tests__/option.browsers.js
22+
```
23+
24+
_Be sure to have in your PATH `./node_modules/.bin` so you can use local
25+
module directly in console._
26+
1727
## Details
1828

1929
### Add a feature

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
"postcss-custom-selectors": "^2.0.1",
4848
"postcss-font-variant": "^1.0.0",
4949
"postcss-import": "^6.0.0",
50-
"postcss-log-warnings": "^0.3.1",
5150
"postcss-media-minmax": "^1.1.0",
5251
"postcss-messages": "^0.2.2",
5352
"postcss-pseudo-class-any-link": "^0.2.1",
5453
"postcss-pseudoelements": "^2.1.1",
54+
"postcss-reporter": "^0.1.0",
5555
"postcss-selector-matches": "^1.0.1",
5656
"postcss-selector-not": "^1.0.1",
5757
"postcss-url": "^3.0.0",
@@ -65,6 +65,7 @@
6565
"babel-core": "^5.4.7",
6666
"babel-eslint": "^3.1.17",
6767
"babel-loader": "^5.1.3",
68+
"babel-tape-runner": "^1.1.0",
6869
"classnames": "^2.1.1",
6970
"css-loader": "^0.13.1",
7071
"cssnext-loader": "^1.0.1",

src/__tests__/options.browsers.js renamed to src/__tests__/option.browsers.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,39 @@ const test = require("tape")
33
const cssnext = require("..")
44

55
test("cssnext browsers option", function(t) {
6-
const input = ":root{--foo:bar}baz{qux:var(--foo)}"
7-
const output = "baz{qux: bar}"
6+
7+
// no recent browser need pixrem
8+
const remInput = "body{font-size:2rem}"
9+
t.equal(
10+
cssnext(
11+
remInput,
12+
{browsers: "last 1 version"}
13+
),
14+
remInput,
15+
"should not enable px fallback when all browsers support it"
16+
)
17+
18+
const customPropsInput = ":root{--foo:bar}baz{qux:var(--foo)}"
19+
const customPropsOutput = "baz{qux: bar}"
820

921
// fx 30 doesn't handle custom prop
1022
t.equal(
11-
cssnext(input, {browsers: "Firefox >= 30"}),
12-
output,
23+
cssnext(customPropsInput, {browsers: "Firefox >= 30"}),
24+
customPropsOutput,
1325
"should enable custom properties when browsers do not support it"
1426
)
1527

1628
// fx 31 handle custom prop
1729
t.equal(
18-
cssnext(input, {browsers: "Firefox >= 31"}),
19-
input,
30+
cssnext(customPropsInput, {browsers: "Firefox >= 31"}),
31+
customPropsInput,
2032
"should NOT enable custom properties when browsers support it"
2133
)
2234

2335
// fx 31 support but not IE 8
2436
t.equal(
25-
cssnext(input, {browsers: "Firefox >= 31, IE 8"}),
26-
output,
37+
cssnext(customPropsInput, {browsers: "Firefox >= 31, IE 8"}),
38+
customPropsOutput,
2739
"should enable custom properties when at least one browsers do not " +
2840
"support it"
2941
)

src/__tests__/option.messages.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ test("cssnext option: messages", (t) => {
6767

6868
// we should do the same for "console" value, but we need to test stdout
6969
// and I am lazy atm. Finger crossed.
70+
// t.ok(
71+
// cssnext({
72+
// ...defaultOptions,
73+
// messages: {
74+
// console: true,
75+
// },
76+
// })
77+
// .process("test{}")
78+
// .css
79+
// ,
80+
// "should show messages in the console"
81+
// )
7082

7183
t.end()
7284
})

src/option.messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import postcssMessagesConsole from "postcss-log-warnings"
1+
import postcssMessagesConsole from "postcss-reporter"
22
// https://github.com/postcss/postcss-messages/issues/16
33
// import postcssMessagesCSS from "postcss-messages"
44
import postcssMessagesCSS from "./plugins/messages"

0 commit comments

Comments
 (0)