Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

feature(slimerjs): up slimerjs to version 1.0.0 #53

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -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'
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -17,7 +17,7 @@
],
"author": "Nicolas Froidure <[email protected]>",
"dependencies": {
"slimerjs": "~0.906.1"
"slimerjs": "^1.0.0"
},
"peerDependencies": {
"karma": ">=0.9"
Expand Down