Я хочу создать потребительские тесты Pact на Angular.
Я поместил pact-зависимости в package.json:
"@pact-foundation/karma-pact": "2.1.9",
"@pact-foundation/pact-node": "6.21.3",
"@pact-foundation/pact-web": "7.2.0",
Затем я обновил свой karma.conf.js:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular', 'pact'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
require('@pact-foundation/karma-pact')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'prod'
},
// load pact web module
files: [
'../node_modules/@pact-foundation/pact-web/pact-web.js'
],
pact: [{
cors: true,
port: 1235,
consumer: "ui",
provider: "testservice",
dir: "pacts",
spec: 2
}],
proxies: {
'/test-service/': 'http://127.0.0.1:1235/test-service/'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_DEBUG,
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: true
});
};
Теперь, когда я запускаю тест ngКарма пытается запустить сервер Pact и выдает ошибку:
07 02 2019 16:14:23.694:DEBUG [plugin]: Loading inlined plugin (defining framework:pact).
10% building modules 2/2 modules 0 active[2019-02-07T15:14:23.890Z] INFO: pact-node@6.21.3/16304 on VAA6DAB0246:
Creating Pact Server with options:
cors = true,
port = 1235,
consumer = ui,
provider = testservice,
dir = D:\Users\aster\WebstormProjects\test\pacts,
spec = 2,
pactFileWriteMode = overwrite,
ssl = false,
host = localhost
[2019-02-07T15:14:23.905Z] INFO: pact-node@6.21.3/16304 on VAA6DAB0246: Created 'standalone\win32-1.63.0\bin\pact-mock-service.bat service --cors 'true' --port '1235' --consumer 'ui' --provider 'testservice' --pact_dir 'D:\Users\aster\WebstormProjects\test\pacts' --pact_specification_version '2' --pact-file-write-mode 'overwrite' --host 'localhost'' process with PID: 35496
[2019-02-07T15:14:31.221Z] ERROR: pact-node@6.21.3/16304 on VAA6DAB0246:
Pact Binary Error: Das System kann den angegebenen Pfad nicht finden.
[2019-02-07T15:14:31.482Z] WARN: pact-node@6.21.3/16304 on VAA6DAB0246: Pact exited with code 1.
[2019-02-07T15:14:31.482Z] INFO: pact-node@6.21.3/16304 on VAA6DAB0246: Removing Pact with PID: 35496
FEHLER: Der Prozess "35496" wurde nicht gefunden. 07 02 2019 16:14:53.913:ERROR [pact]: Error while trying to run karma-pact: Error: Couldn't start Pact with PID: 35496
Кто-нибудь знает, как исправить эту ошибку?Или, может быть, есть идеи, как узнать, какой путь отсутствует?