forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
decaffeinate: Convert actionability.coffee and 14 other files to JS
- Loading branch information
Showing
15 changed files
with
5,246 additions
and
4,529 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,44 @@ | ||
fs = require("fs") | ||
path = require("path") | ||
Promise = require("bluebird") | ||
background = require("../app/background") | ||
|
||
fs = Promise.promisifyAll(fs) | ||
/* | ||
* decaffeinate suggestions: | ||
* DS102: Remove unnecessary code created because of implicit returns | ||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md | ||
*/ | ||
let fs = require("fs"); | ||
const path = require("path"); | ||
const Promise = require("bluebird"); | ||
const background = require("../app/background"); | ||
|
||
fs = Promise.promisifyAll(fs); | ||
|
||
module.exports = { | ||
getPathToExtension: (args...) -> | ||
args = [__dirname, "..", "dist"].concat(args) | ||
getPathToExtension(...args) { | ||
args = [__dirname, "..", "dist"].concat(args); | ||
|
||
path.join.apply(path, args) | ||
return path.join.apply(path, args); | ||
}, | ||
|
||
getPathToTheme: -> | ||
path.join(__dirname, "..", "theme") | ||
getPathToTheme() { | ||
return path.join(__dirname, "..", "theme"); | ||
}, | ||
|
||
getPathToRoot: -> | ||
path.join(__dirname, "..") | ||
getPathToRoot() { | ||
return path.join(__dirname, ".."); | ||
}, | ||
|
||
setHostAndPath: (host, path) -> | ||
src = @getPathToExtension("background.js") | ||
setHostAndPath(host, path) { | ||
const src = this.getPathToExtension("background.js"); | ||
|
||
fs.readFileAsync(src, "utf8") | ||
.then (str) -> | ||
return fs.readFileAsync(src, "utf8") | ||
.then(str => | ||
str | ||
.replace("CHANGE_ME_HOST", host) | ||
.replace("CHANGE_ME_PATH", path) | ||
); | ||
}, | ||
|
||
getCookieUrl: background.getUrl | ||
getCookieUrl: background.getUrl, | ||
|
||
connect: background.connect | ||
connect: background.connect, | ||
|
||
app: background | ||
} | ||
}; |
Oops, something went wrong.