Skip to content

Commit 4135dcf

Browse files
committed
Enable test skipping.
1 parent 96468ed commit 4135dcf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/unit/resource-mapper-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const chai = require('chai')
33
const { expect } = chai
44
chai.use(require('chai-as-promised'))
55

6+
const itMapsUrl = asserter(mapsUrl)
7+
68
describe('ResourceMapper', () => {
79
describe('A ResourceMapper instance for a single-user setup', () => {
810
const rootPath = '/var/www/folder/'
@@ -52,7 +54,14 @@ describe('ResourceMapper', () => {
5254
})
5355
})
5456

55-
function itMapsUrl (mapper, label, options, expected) {
57+
function asserter (assert) {
58+
const f = (...args) => assert(it, ...args)
59+
f.skip = (...args) => assert(it.skip, ...args)
60+
f.only = (...args) => assert(it.only, ...args)
61+
return f
62+
}
63+
64+
function mapsUrl (it, mapper, label, options, expected) {
5665
if (!(expected instanceof Error)) {
5766
it(`maps ${label}`, async () => {
5867
const actual = await mapper.mapUrlToFile(options)

0 commit comments

Comments
 (0)