Merge pull request #3192 from shashanktomar/updateJest

Upgraded jest version
This commit is contained in:
Jean-Laurent de Morlhon 2018-08-28 19:44:42 +02:00 коммит произвёл GitHub
Родитель 082bfd558a d0199d6d8e
Коммит 5fc35f04d4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -8,7 +8,7 @@ describe('Util', () => {
time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: /usr/bin/VBoxManage showvminfo dev2 --machinereadable"`; time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: /usr/bin/VBoxManage showvminfo dev2 --machinereadable"`;
expect(util.removeSensitiveData(testdata).indexOf('CERTIFICATE')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('CERTIFICATE')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('nX5Vh1bslYJzsSdBNZFWSKShZ+gtRpjtV7NynANDJPQNIRhDxAf4uDY9hA2c')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('nX5Vh1bslYJzsSdBNZFWSKShZ+gtRpjtV7NynANDJPQNIRhDxAf4uDY9hA2c')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).toNotEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).not.toEqual(-1);
}); });
it('filters ssh private key data', () => { it('filters ssh private key data', () => {
@ -17,23 +17,23 @@ describe('Util', () => {
time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50483 -i /Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo \"-----BEGIN CERTIFICATE-----\nMIIC+DCCAeKgAwIBAgIRANfIbsa2M94gDY+fBiBiQBkwCwYJKoZIhvcNAQELMBIx\nEDAOBg`; time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50483 -i /Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo \"-----BEGIN CERTIFICATE-----\nMIIC+DCCAeKgAwIBAgIRANfIbsa2M94gDY+fBiBiQBkwCwYJKoZIhvcNAQELMBIx\nEDAOBg`;
expect(util.removeSensitiveData(testdata).indexOf('PRIVATE')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('PRIVATE')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('94fYH4W1Fq0uDJ9kZ7oItLyF5EPaLlY9E8+YuJBl0OSTtdicROUv')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('94fYH4W1Fq0uDJ9kZ7oItLyF5EPaLlY9E8+YuJBl0OSTtdicROUv')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).toNotEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).not.toEqual(-1);
}); });
it('filters username data', () => { it('filters username data', () => {
var testdata = String.raw`/Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo`; var testdata = String.raw`/Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo`;
expect(util.removeSensitiveData(testdata).indexOf('/Users/johnappleseed/')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('/Users/johnappleseed/')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('/Users/<redacted>/')).toNotEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('/Users/<redacted>/')).not.toEqual(-1);
testdata = String.raw`/Users/some.wei-rdUsername/.docker/machine/machines/dev2/id_rsa docker@localhost echo`; testdata = String.raw`/Users/some.wei-rdUsername/.docker/machine/machines/dev2/id_rsa docker@localhost echo`;
expect(util.removeSensitiveData(testdata).indexOf('/Users/some.wei-rdUsername/.docker')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('/Users/some.wei-rdUsername/.docker')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('/Users/<redacted>/.docker')).toNotEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('/Users/<redacted>/.docker')).not.toEqual(-1);
}); });
it('filters Windows username data', () => { it('filters Windows username data', () => {
var testdata = String.raw`C:\\Users\\johnappleseed\\.docker\\machine`; var testdata = String.raw`C:\\Users\\johnappleseed\\.docker\\machine`;
expect(util.removeSensitiveData(testdata).indexOf('johnappleseed')).toEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('johnappleseed')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).toNotEqual(-1); expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).not.toEqual(-1);
}); });
it ('returns input if empty or not a string', () => { it ('returns input if empty or not a string', () => {

Просмотреть файл

@ -1,7 +1,7 @@
{ {
"testDirectoryName": "__integration__", "testMatch": ["**/__integration__/**/*.js"],
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest", "transform": {".*": "<rootDir>/node_modules/babel-jest"},
"setupEnvScriptFile": "<rootDir>/util/testenv.js", "setupFiles": ["<rootDir>/util/testenv.js"],
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js", "setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
"unmockedModulePathPatterns": [ "unmockedModulePathPatterns": [
"babel", "babel",

Просмотреть файл

@ -1,6 +1,6 @@
{ {
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest", "transform": { ".*": "<rootDir>/node_modules/babel-jest" },
"setupEnvScriptFile": "<rootDir>/util/testenv.js", "setupFiles": ["<rootDir>/util/testenv.js"],
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js", "setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
"unmockedModulePathPatterns": [ "unmockedModulePathPatterns": [
"alt", "alt",

Просмотреть файл

@ -89,7 +89,7 @@
"grunt-rename": "^0.1.4", "grunt-rename": "^0.1.4",
"grunt-shell": "^1.1.2", "grunt-shell": "^1.1.2",
"grunt-shell-spawn": "^0.3.8", "grunt-shell-spawn": "^0.3.8",
"jest-cli": "^0.8.2", "jest-cli": "^21.2.1",
"jsxhint": "^0.15.1", "jsxhint": "^0.15.1",
"load-grunt-tasks": "^3.2.0", "load-grunt-tasks": "^3.2.0",
"minimist": "^1.1.1", "minimist": "^1.1.1",