2017-07-26 3 views
0

Ich versuche, PactJS zu verwenden und Pakte zu generieren.Fehler: Kein Provider für "Framework: Pakt"

I Karma/Jasmin bin mit meinen Tests laufen ..

Unten ist mein package.json

{ 
    "name": "andriod-pact", 
    "version": "1.0.0", 
    "description": "This is a microservice that is one of the two consumers of 
the provider microservice", 
    "main": "index.js", 
    "scripts": { 
    "test": "echo \"Error: no test specified\" && exit 1" 
}, 
    "author": "", 
    "license": "ISC", 
    "devDependencies": { 
    "jasmine": "^2.6.0", 
    "karma": "^1.7.0", 
    "karma-phantomjs-launcher": "^1.0.4", 
    "pact": "^2.6.0" 
} 
} 

Und das ist meine karma.conf Datei

// Karma Konfiguration // Generiert am Di 25 Jul 2017 15:32:06 GMT + 0200 (W. Europa Sommerzeit)

module.exports = function(config) { 
     config.set({ 

     // base path that will be used to resolve all patterns (eg. files, exclude) 
     basePath: '', 

     // frameworks to use 
     // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 
     frameworks: ['jasmine', 'pact'], 

     // list of files/patterns to load in the browser 
     files: [ 
     '../../dist/pact-web.js', 
     'src/test/js/*.js' 
     ], 


     // list of files to exclude 
     exclude: [ 
     ], 


     // preprocess matching files before serving them to the browser 
     // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 
     preprocessors: { 
     }, 


     // test results reporter to use 
     // possible values: 'dots', 'progress' 
     // available reporters: https://npmjs.org/browse/keyword/karma-reporter 
     reporters: ['progress'], 


     // web server port 
     port: 9876, 


     // enable/disable colors in the output (reporters and logs) 
     colors: true, 


     // level of logging 
     // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 
     logLevel: config.LOG_INFO, 


     // enable/disable watching file and executing tests whenever any file changes 
     autoWatch: true, 


     // start these browsers 
     // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 
     browsers: ['PhantomJS_without_security'], 

     customLaunchers: { 
      PhantomJS_without_security: { 
      base: 'PhantomJS', 
      flags: ['--web-security=no'] 
      } 
     }, 

     // Continuous Integration mode 
     // if true, Karma captures browsers, runs the tests and exits 
     singleRun: false, 

     // Concurrency level 
     // how many browser should be started simultaneous 
     concurrency: Infinity 
     }) 
    } 
Aber

wenn ich betreibe meine Tests mit Karma Start karma.conf

Ich erhalte diese Fehler

Error: No provider for "framework:pact"! (Resolving: framework:pact) 
    at error (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\di\lib\injector.js:22:12) 
    at Object.parent.get (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\di\lib\injector.js:9:13) 
    at get (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\di\lib\injector.js:54:19) 
    at C:\PactDemoMaster\PactDemoAndroidApp\node_modules\karma\lib\server.js:143:20 
    at Array.forEach (native) 
    at Server._start (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\karma\lib\server.js:142:21) 
    at invoke (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\di\lib\injector.js:75:15) 
    at Server.start (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\karma\lib\server.js:103:18) 
    at Object.exports.run (C:\PactDemoMaster\PactDemoAndroidApp\node_modules\karma\lib\cli.js:280:26) 
    at requireCliAndRun (C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:44:16) 
    at C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:54:12 
    at C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:45:21 
    at ondir (C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:196:27) 
    at C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:163:39 
    at onex (C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:104:32) 
    at C:\Users\aajai_000\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:24:24 

Wenn mich jemand auf das offensichtliche Problem zeigen kann ...

Grüße

Antwort

0

Sie vermissen das karma-pact Plugin, es kommt standardmäßig nicht mit der Standardpaktabhängigkeit.

Siehe https://github.com/pact-foundation/karma-pact.

+0

Dank Matt zurück gekommen ... Aber danach tun, ich bin die unten Fehler ' Fehler beim Abruf: Der Prozess "9488": Befehl fehlgeschlagen: taskkill/f/t/pid 9488 ERROR nicht gefunden. bei checkExecSyncError (child_process.js: 486: 13) bei Object.execSync (child_process.js: 526: 13) bei Server.stop (C: \ PactDemoMaster \ PactDemoAndroidApp \ node_modules \ @ Pakt-Stiftung \ Paktes-node \ src \ server.js: 138: 7) bei Server.delete (C: \ PactDemoMaster \ PactDemoAndroidApp \ node_module \ @ pact-foundation \ pact-node \ src \ server.js: 155: 14) ' – abhishek

+0

Können Sie bitte heben Sie dies als Bug auf Pact Js Repo? Sieht aus wie ein Windows-Problem. Das Karma-Pact-Plugin startet aber anscheinend. –

Verwandte Themen