Skip to content

Commit ab7bb6d

Browse files
committed
1.2.0
1 parent 7eeb60d commit ab7bb6d

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes to PostCSS Tape
22

3+
### 1.2.0 (December 14, 2016)
4+
5+
- Added: Expected `error` option
6+
- Added: `after` command to run option
7+
38
### 1.1.0 (December 8, 2016)
49

510
- Added: Support `plugins#process` with separate arguments

index.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,27 @@ Promise.all(Object.keys(tests).map(
9797
return ` ${ pass } ${ test.message }`;
9898
}
9999
}
100-
)
100+
),
101+
(error) => {
102+
const expectedError = test.error && Object.keys(test.error).every(
103+
(key) => test.error[key] === error[key]
104+
);
105+
106+
if (expectedError) {
107+
return ` ${ pass } ${ test.message }`;
108+
} else {
109+
throw error;
110+
}
111+
}
101112
)
113+
).then(
114+
(result) => {
115+
if (test.after) {
116+
test.after();
117+
}
118+
119+
return result;
120+
}
102121
);
103122
}
104123
)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-tape",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Quickly test a PostCSS Plugin",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",

0 commit comments

Comments
 (0)