@browserless/test 9.6.6 → 9.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +13 -13
  2. package/package.json +2 -2
  3. package/LICENSE.md +0 -21
package/index.js CHANGED
@@ -49,13 +49,13 @@ const getServerUrl = (() => {
49
49
  return () => Promise.resolve(initializedServer)
50
50
  })()
51
51
 
52
- module.exports = (browserlessFactory, teardown = browserlessFactory.close) => {
52
+ module.exports = (browser, teardown = browser.close) => {
53
53
  exitHook(teardown)
54
54
 
55
55
  test('.html', async t => {
56
56
  const url = await getServerUrl()
57
- const browserless = await browserlessFactory.createContext()
58
- t.teardown(() => browserless.destroyContext())
57
+ const browserless = await browser.createContext()
58
+ t.teardown(browserless.destroyContext)
59
59
  const html = await browserless.html(url, { adblock: false, animations: true })
60
60
  t.snapshot(html)
61
61
  })
@@ -63,8 +63,8 @@ module.exports = (browserlessFactory, teardown = browserlessFactory.close) => {
63
63
  test('.text', async t => {
64
64
  const url = await getServerUrl()
65
65
 
66
- const browserless = await browserlessFactory.createContext()
67
- t.teardown(() => browserless.destroyContext())
66
+ const browserless = await browser.createContext()
67
+ t.teardown(browserless.destroyContext)
68
68
  const text = await browserless.text(url)
69
69
 
70
70
  t.snapshot(text)
@@ -74,8 +74,8 @@ module.exports = (browserlessFactory, teardown = browserlessFactory.close) => {
74
74
  const url = await getServerUrl()
75
75
  const filepath = temp.file({ extension: 'png' })
76
76
 
77
- const browserless = await browserlessFactory.createContext()
78
- t.teardown(() => browserless.destroyContext())
77
+ const browserless = await browser.createContext()
78
+ t.teardown(browserless.destroyContext)
79
79
  await browserless.screenshot(url, { path: filepath })
80
80
 
81
81
  const { diffCount } = await imageComparison(t, filepath, 'example.png')
@@ -90,8 +90,8 @@ module.exports = (browserlessFactory, teardown = browserlessFactory.close) => {
90
90
  const url = await getServerUrl()
91
91
  const filepath = temp.file({ extension: 'jpeg' })
92
92
 
93
- const browserless = await browserlessFactory.createContext()
94
- t.teardown(() => browserless.destroyContext())
93
+ const browserless = await browser.createContext()
94
+ t.teardown(browserless.destroyContext)
95
95
  await browserless.screenshot(url, { type: 'jpeg', path: filepath })
96
96
 
97
97
  const { diffCount } = await imageComparison(t, filepath, 'example.jpeg')
@@ -106,8 +106,8 @@ module.exports = (browserlessFactory, teardown = browserlessFactory.close) => {
106
106
  const url = await getServerUrl()
107
107
  const filepath = temp.file({ extension: 'png' })
108
108
 
109
- const browserless = await browserlessFactory.createContext()
110
- t.teardown(() => browserless.destroyContext())
109
+ const browserless = await browser.createContext()
110
+ t.teardown(browserless.destroyContext)
111
111
  await browserless.screenshot(url, { device: 'iPhone 6', path: filepath })
112
112
 
113
113
  const { diffCount } = await imageComparison(t, filepath, 'iphone.png')
@@ -121,8 +121,8 @@ module.exports = (browserlessFactory, teardown = browserlessFactory.close) => {
121
121
  test('.pdf', async t => {
122
122
  const url = await getServerUrl()
123
123
 
124
- const browserless = await browserlessFactory.createContext()
125
- t.teardown(() => browserless.destroyContext())
124
+ const browserless = await browser.createContext()
125
+ t.teardown(browserless.destroyContext)
126
126
  const buffer = await browserless.pdf(url)
127
127
 
128
128
  const data = await pdf(buffer)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/test",
3
3
  "description": "A test suite for browserless API",
4
4
  "homepage": "https://browserless.js.org",
5
- "version": "9.6.6",
5
+ "version": "9.7.2",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -53,5 +53,5 @@
53
53
  "test": "exit 0"
54
54
  },
55
55
  "license": "MIT",
56
- "gitHead": "74da0ac7388ee354aec0517218afb143ec6a095d"
56
+ "gitHead": "49eb374d4c0a2f735ae2a536d4e3d011abbed6a6"
57
57
  }
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright © 2019 Microlink <hello@microlink.io> (microlink.io)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.