html-browser-tester 0.0.2 → 0.0.4

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.
package/README.md CHANGED
@@ -35,7 +35,7 @@ const html = `
35
35
  `
36
36
 
37
37
  const main = async () => {
38
- const browserTester = new BrowserTesterer({ html, width: 980, height: 980 })
38
+ const browserTester = new BrowserTester({ html, width: 980, height: 980 })
39
39
 
40
40
  browserTester.test('h1,h2 textContent should have right textContent', async (_, doc) => {
41
41
  const h1 = doc.querySelector('h1')
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "html-browser-tester",
3
3
  "main": "./lib/browser-test.js",
4
4
  "types": "./lib/browser-test.d.ts",
5
- "version": "0.0.2",
5
+ "version": "0.0.4",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "preview": "vite preview",
@@ -68,6 +68,10 @@ export class BrowserTester {
68
68
  return this.expects.expect(value)
69
69
  }
70
70
 
71
+ clearTests() {
72
+ this.tests = []
73
+ }
74
+
71
75
  run() {
72
76
  return new Promise<Result[]>((resolve) => {
73
77
  const blob = new Blob(
@@ -78,6 +82,8 @@ export class BrowserTester {
78
82
  const iframe = document.createElement('iframe')
79
83
  const body = document.querySelector('body') as HTMLBodyElement
80
84
  this.iframe = iframe
85
+ iframe.style.opacity = '0'
86
+ iframe.style.pointerEvents = 'none'
81
87
  iframe.src = url
82
88
  if (this.width && this.height) {
83
89
  iframe.width = `${this.width}px`