This will definitely save time, and ensure more uniformity. It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter. Closes #2701
29 lines
683 B
JavaScript
29 lines
683 B
JavaScript
import { test, given } from 'sazerac'
|
|
import pathToRegexp from 'path-to-regexp'
|
|
import PathBuilder from './path-builder'
|
|
|
|
describe('<PathBuilder />', function() {
|
|
const tokens = pathToRegexp.parse('github/license/:user/:repo')
|
|
test(PathBuilder.constructPath, () => {
|
|
given({
|
|
tokens,
|
|
namedParams: {
|
|
user: 'paulmelnikow',
|
|
repo: 'react-boxplot',
|
|
},
|
|
}).expect({
|
|
path: 'github/license/paulmelnikow/react-boxplot',
|
|
isComplete: true,
|
|
})
|
|
given({
|
|
tokens,
|
|
namedParams: {
|
|
user: 'paulmelnikow',
|
|
},
|
|
}).expect({
|
|
path: 'github/license/paulmelnikow/:repo',
|
|
isComplete: false,
|
|
})
|
|
})
|
|
})
|