Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 6be462b

Browse files
committed
style(prettier): run prettier on old js PRs
1 parent 2a2df31 commit 6be462b

4 files changed

+25
-28
lines changed

examples/extract-google-results.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ async function run() {
1010
.wait('#resultStats')
1111
.evaluate(() => {
1212
// this will be executed in headless chrome
13-
const links = [].map.call(
14-
document.querySelectorAll('.g h3 a'),
15-
a => ({title: a.innerText, href: a.href})
16-
)
13+
const links = [].map.call(document.querySelectorAll('.g h3 a'), a => ({
14+
title: a.innerText,
15+
href: a.href,
16+
}))
1717
return JSON.stringify(links)
1818
})
1919
// you can still use the method chaining API after evaluating

examples/mocha-chai-test-example.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,37 @@ const { expect } = require('chai')
55
// to run this example just run
66
// mocha path/to/this/file
77

8-
describe('When searching on google', function () {
9-
it('shows results', async function () {
10-
this.timeout(10000); //we need to increase the timeout or else mocha will exit with an error
8+
describe('When searching on google', function() {
9+
it('shows results', async function() {
10+
this.timeout(10000) //we need to increase the timeout or else mocha will exit with an error
1111
const chromeless = new Chromeless()
1212

13-
await chromeless.goto('https://google.com')
13+
await chromeless
14+
.goto('https://google.com')
1415
.wait('input[name="q"]')
1516
.type('chromeless github', 'input[name="q"]')
1617
.press(13) // press enter
1718
.wait('#resultStats')
1819

19-
2020
const result = await chromeless.exists('a[href*="graphcool/chromeless"]')
2121

22-
2322
expect(result).to.be.true
2423
await chromeless.end()
2524
})
2625
})
2726

28-
describe('When clicking on the image of the demo playground', function () {
29-
it('should redirect to the demo', async function () {
30-
this.timeout(10000); //we need to increase the timeout or else mocha will exit with an error
27+
describe('When clicking on the image of the demo playground', function() {
28+
it('should redirect to the demo', async function() {
29+
this.timeout(10000) //we need to increase the timeout or else mocha will exit with an error
3130
const chromeless = new Chromeless()
32-
await chromeless.goto('https://github.com/graphcool/chromeless')
31+
await chromeless
32+
.goto('https://github.com/graphcool/chromeless')
3333
.wait('a[href="https://chromeless.netlify.com/"]')
3434
.click('a[href="https://chromeless.netlify.com/"]')
3535
.wait('#root')
3636

37-
3837
const url = await chromeless.evaluate(url => window.location.href)
3938

40-
4139
expect(url).to.match(/^https\:\/\/chromeless\.netlify\.com/)
4240
await chromeless.end()
4341
})

examples/mouse-event-example.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
const { Chromeless } = require('chromeless')
22

33
async function run() {
4-
const chromeless = new Chromeless()
4+
const chromeless = new Chromeless()
55

6-
const screenshot = await chromeless
7-
.goto('https://www.google.com')
8-
.mousedown('input[name="btnI"]')
9-
.mouseup('input[name="btnI"]')
10-
.wait('.latest-doodle')
11-
.screenshot()
6+
const screenshot = await chromeless
7+
.goto('https://www.google.com')
8+
.mousedown('input[name="btnI"]')
9+
.mouseup('input[name="btnI"]')
10+
.wait('.latest-doodle')
11+
.screenshot()
1212

13-
console.log(screenshot)
13+
console.log(screenshot)
1414

15-
await chromeless.end()
15+
await chromeless.end()
1616
}
1717

1818
run().catch(console.error.bind(console))

examples/twitter.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { Chromeless } = require('chromeless')
22

3-
const twitterUsername = "xxx"
4-
const twitterPassword = "xxx"
3+
const twitterUsername = 'xxx'
4+
const twitterPassword = 'xxx'
55

66
async function run() {
77
const chromeless = new Chromeless()
@@ -18,4 +18,3 @@ async function run() {
1818
}
1919

2020
run().catch(console.error.bind(console))
21-

0 commit comments

Comments
 (0)