зеркало из https://github.com/microsoft/just.git
adding some tests
This commit is contained in:
Родитель
cd7fd3187f
Коммит
67f7c1d438
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
roots: ['<rootDir>/src'],
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/?(*.)+(spec|test).(j|t)s?(x)']
|
||||
};
|
|
@ -5,7 +5,8 @@
|
|||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc -w --preserveWatchOutput"
|
||||
"dev": "tsc -w --preserveWatchOutput",
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^2.4.1",
|
||||
|
@ -29,6 +30,7 @@
|
|||
"@types/run-parallel-limit": "^1.0.0",
|
||||
"@types/semver": "^5.5.0",
|
||||
"@types/webpack": "^4.4.20",
|
||||
"@types/jest": "^23.3.10",
|
||||
"typescript": ">=2.8.0 <4.0.0",
|
||||
"jest": ">=22.0.0"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { encodeArgs } from '../exec';
|
||||
|
||||
describe('encodeArgs', () => {
|
||||
it('encodes things with spaces with double quotes', () => {
|
||||
const args = encodeArgs(['blah blah']);
|
||||
expect(args[0]).toBe('"blah blah"');
|
||||
});
|
||||
|
||||
it('encodes Windows-like paths', () => {
|
||||
const args = encodeArgs(['C:\\Program Files\\node\\bin\\node.exe']);
|
||||
expect(args[0]).toBe('"C:\\Program Files\\node\\bin\\node.exe"');
|
||||
});
|
||||
|
||||
it('leaves normal args alone', () => {
|
||||
const args = encodeArgs(['this-is-normal']);
|
||||
expect(args[0]).toBe('this-is-normal');
|
||||
});
|
||||
});
|
Загрузка…
Ссылка в новой задаче