{{ message }}
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
Open
Conversation
Author
schickling
reviewed
Aug 8, 2017
| @@ -1,9 +1,14 @@ | |||
| const { Chromeless } = require('chromeless') | |||
| const { Chromeless } = require('../dist/src') | |||
Owner
There was a problem hiding this comment.
Please keep chromeless here so other people have an easier time trying it.
schickling
reviewed
Aug 8, 2017
| async function run() { | ||
| const chromeless = new Chromeless({ remote: true }) | ||
| async function run () { | ||
| const chromeless = await new Chromeless({ |
Owner
There was a problem hiding this comment.
Please remove any chromeless arguments here. (There also shouldn't have been a { remote: true }.)
Open
Author
|
I have it up to 98% coverage now: https://coveralls.io/github/geoffdutton/chromeless?branch=jest-tests Any thoughts around this? Should I create some more functional tests? |
| fn: string, | ||
| ...args: any[] | ||
| ): Promise<T> { | ||
| const { Runtime } = client |
| @@ -291,10 +254,7 @@ export async function scrollTo( | |||
| y: number, | |||
| ): Promise<void> { | |||
| const { Runtime } = client | |||
There was a problem hiding this comment.
Above in the file you've removed destructuring
| async function run () { | ||
| const chromeless = await new Chromeless() | ||
|
|
||
| const links = await chromeless |
There was a problem hiding this comment.
This is incorrect, did you mean to commit this one?
There was a problem hiding this comment.
alot of good catches in this file
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I'm proposing this unit testing setup which replaces Ava and NYC with Jest. I'm proposing Jest over Ava/NYC due to the mocking features and built in coverage. Jest also supports a preprocessor (using ts-jest), which was smoother than running
tsc -w & ava -w. I also selfishly have more experience with Jest testing. Is anyone opposed to using Jest?With regards to debugging, especially when unit testing, with Node 8 I could not get break points to hit in Webstorm. Switching to Node 7 fixed that.
The only major changes are a few spots where the CDP port wasn't being passed, rather it was defaulting to 9222. For example, in
utils.ts, thesetViewPortfunction was callingCDP.Version()without passing any CDP options.Otherwise, I've mainly added unit tests. There shouldn't be any breaking changes.
This is the first time I've worked with TypeScript, so I'd welcome any feedback of my changes.
Let me know your thoughts. Thanks!