diff --git a/index.js b/index.js index a89850f..5bdcdd0 100644 --- a/index.js +++ b/index.js @@ -8,28 +8,6 @@ function serializeOption (value) { return JSON.stringify(value) } -var slimerDir = function () { - var slimerSource = require('slimerjs').path - return path.dirname(slimerSource) -} - -var slimerJSExePath = function () { - return path.join(slimerDir(), '/xulrunner/xulrunner.exe') -} - -var isWindows = function () { - return /^win/.test(process.platform) -} - -var windowsFlags = function (tempDir) { - return [ - '-app', path.join(slimerDir(), '/application.ini'), - '-profile', path.join(tempDir, '/slimerjs-profile'), - '-attach-console', - '-no-remote' - ] -} - var SlimerJSBrowser = function (baseBrowserDecorator, config, args) { baseBrowserDecorator(this) @@ -55,7 +33,6 @@ var SlimerJSBrowser = function (baseBrowserDecorator, config, args) { optionsCode.join('\n') + '\npage.open("' + url + '");\n' fs.writeFileSync(captureFile, captureCode) - if (isWindows()) flags = flags.concat(windowsFlags(this._tempDir)) flags = flags.concat(captureFile) // Start SlimerJS @@ -69,7 +46,7 @@ SlimerJSBrowser.prototype = { DEFAULT_CMD: { linux: require('slimerjs').path, darwin: require('slimerjs').path, - win32: slimerJSExePath() + win32: path.join(path.dirname(require('slimerjs').path), '/slimerjs.bat') }, ENV_CMD: 'SLIMERJS_BIN' } diff --git a/package.json b/package.json index 99f50b9..a4f1be5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "karma-slimerjs-launcher", - "version": "1.1.0", + "version": "2.0.0", "description": "A Karma plugin. Launcher for SlimerJS.", "main": "index.js", "scripts": { @@ -17,7 +17,7 @@ ], "author": "Nicolas Froidure ", "dependencies": { - "slimerjs": "~0.906.1" + "slimerjs": "^1.0.0" }, "peerDependencies": { "karma": ">=0.9"