Skip to content

Commit bbd9bcc

Browse files
committed
Update unexpected usage to avoid deprecated syntax
1 parent 1178453 commit bbd9bcc

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

test/compiless.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@ describe('compiless', () => {
77
const root = Path.resolve(__dirname, 'root');
88
const expect = unexpected
99
.clone()
10-
.installPlugin(require('unexpected-express'))
11-
.addAssertion('to yield response', (expect, subject, value) =>
12-
expect(
13-
express()
14-
.use(compiless({ root }))
15-
.use('/hello', (req, res, next) => {
16-
res.setHeader('Content-Type', 'text/plain');
17-
res.setHeader('ETag', 'W/"fake-etag"');
18-
res.status(200);
19-
res.write('world');
20-
res.end();
21-
})
22-
.use(express.static(root)),
23-
'to yield exchange',
24-
{
25-
request: subject,
26-
response: value,
27-
}
28-
)
10+
.use(require('unexpected-express'))
11+
.addAssertion(
12+
'<string|object> to yield response <object>',
13+
(expect, subject, value) =>
14+
expect(
15+
express()
16+
.use(compiless({ root }))
17+
.use('/hello', (req, res, next) => {
18+
res.setHeader('Content-Type', 'text/plain');
19+
res.setHeader('ETag', 'W/"fake-etag"');
20+
res.status(200);
21+
res.write('world');
22+
res.end();
23+
})
24+
.use(express.static(root)),
25+
'to yield exchange',
26+
{
27+
request: subject,
28+
response: value,
29+
}
30+
)
2931
);
3032

3133
it('should not mess with request for non-less file', () =>

0 commit comments

Comments
 (0)