forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-r-package.spec.js
More file actions
28 lines (25 loc) · 871 Bytes
/
Copy pathgithub-r-package.spec.js
File metadata and controls
28 lines (25 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { expect } from 'chai'
import { test, given } from 'sazerac'
import { InvalidResponse } from '../index.js'
import GithubRPackageVersion from './github-r-package.service.js'
describe('GithubRPackageVersion', function () {
const content = versionLine =>
[
'Package: mypackage',
'Title: What The Package Does (one line, title case required)',
versionLine,
'',
].join('\n')
test(GithubRPackageVersion.transform, () => {
given(content('Version: 6.10.9'), 'DESCRIPTION').expect({
version: '6.10.9',
})
})
it('throws InvalidResponse if a file does not contain version specification', function () {
expect(() =>
GithubRPackageVersion.transform(content('Versio: 6.10.9'), 'DESCRIPTION')
)
.to.throw(InvalidResponse)
.with.property('prettyMessage', 'Version missing in DESCRIPTION')
})
})