Skip to content

Commit

Permalink
Merge pull request #84 from yujiosaka/e2e_test
Browse files Browse the repository at this point in the history
E2e test
  • Loading branch information
yujiosaka authored Jan 19, 2018
2 parents c1ea0b2 + 52741de commit 10dfe10
Show file tree
Hide file tree
Showing 7 changed files with 489 additions and 171 deletions.
6 changes: 3 additions & 3 deletions lib/crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ class Crawler {
* @private
*/
_handlePageEvents() {
this._page.on('pageerror', msg => void debugConsole(msg));
this._page.on('console', msg => void debugConsole(`${msg.type} ${msg.text} at ${this._options.url}`));
this._page.on('pageerror', text => void debugConsole(text));
this._page.on('console', msg => void debugConsole(`${msg.type()} ${msg.text()} at ${this._options.url}`));
this._page.on('dialog', dialog => this._handleDialog(dialog));
}

Expand All @@ -146,7 +146,7 @@ class Crawler {
* @private
*/
_handleDialog(dialog) {
debugDialog(`${dialog.type} ${dialog.message()} at ${this._options.url}`);
debugDialog(`${dialog.type()} ${dialog.message()} at ${this._options.url}`);
return dialog.dismiss();
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"eslint": "4.15.0",
"eslint-config-airbnb": "16.1.0",
"eslint-plugin-import": "2.8.0",
"mime": "2.2.0",
"mocha": "5.0.0",
"power-assert": "1.4.4",
"sinon": "4.1.6"
Expand Down
3 changes: 3 additions & 0 deletions test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
"extends": "../.eslintrc.js",
"globals": {
'$': true,
},
"env": {
"mocha": true,
},
Expand Down
Loading

0 comments on commit 10dfe10

Please sign in to comment.