-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathwb-add-alias.js
34 lines (32 loc) · 967 Bytes
/
wb-add-alias.js
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
29
30
31
32
33
34
import 'should'
import { wbDry } from '#test/lib/utils'
describe('wb add-alias', () => {
it('should accept an id, a lang, and a value', async () => {
const { stdout, stderr } = await wbDry('add-alias Q4115189 fr foo')
stderr.should.equal('')
const { section, action, args } = JSON.parse(stdout)
section.should.equal('alias')
action.should.equal('add')
args.should.deepEqual([
{
id: 'Q4115189',
language: 'fr',
value: [ 'foo' ],
},
])
})
it('should accept an id, a lang, and multipled piped values', async () => {
const { stdout, stderr } = await wbDry('add-alias Q4115189 fr "foo|bar|buzz"')
stderr.should.equal('')
const { section, action, args } = JSON.parse(stdout)
section.should.equal('alias')
action.should.equal('add')
args.should.deepEqual([
{
id: 'Q4115189',
language: 'fr',
value: [ 'foo', 'bar', 'buzz' ],
},
])
})
})