-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
29 lines (24 loc) · 753 Bytes
/
test.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
/*!
* cp-file-cli <https://github.com/tunnckoCore/cp-file-cli>
*
* Copyright (c) Charlike Mike Reagent <@tunnckoCore> (http://i.am.charlike.online)
* Released under the MIT license.
*/
/* jshint asi:true */
'use strict'
const execa = require('execa')
const test = require('mukla')
test('should fail if not enough arguments', (done) => {
return execa('node', ['./cli.js']).catch((err) => {
test.ok(/CpFileError: `src` and `dest` required/.test(err.message))
done()
})
})
test('should copy single file', (done) => {
return execa('node', ['./cli.js', 'LICENSE', 'node_modules/FOO']).then((res) => {
test.strictEqual(res.code, 0)
test.strictEqual(res.killed, false)
test.strictEqual(res.failed, false)
done()
})
})