update puppeteer jest setup

This commit is contained in:
Rene
2020-09-05 19:45:20 +02:00
parent e11e36531f
commit 38d26495c4
15 changed files with 2532 additions and 153 deletions
@@ -0,0 +1,4 @@
<div id="a"></div>
<div id="b"></div>
<div id="c"></div>
<div id="d"></div>
@@ -1,9 +1,15 @@
describe('Google', () => {
import html from './build/build.html';
describe('Environment', () => {
beforeAll(async () => {
await page.goto('https://google.com');
await page.setContent(html, { waitUntil: 'domcontentloaded' });
});
it('should be titled "Google"', async () => {
await expect(page.title()).resolves.toMatch('Google');
it('should be titled "Environment"', async () => {
await expect(page).toMatchElement('#a');
await expect(page).toMatchElement('#b');
await expect(page).toMatchElement('#c');
await expect(page).toMatchElement('#d');
await expect(page.title()).resolves.toMatch('Environment');
});
});
@@ -1,4 +1,6 @@
import { Environment } from 'environment';
import 'some.scss';
import 'some.css';
// eslint-disable-next-line
console.log(new Environment());
+14
View File
@@ -0,0 +1,14 @@
declare module '*.css' {
const content: string;
export default content;
}
declare module '*.scss' {
const content: string;
export default content;
}
declare module '*.html' {
const content: string;
export default content;
}
+3
View File
@@ -0,0 +1,3 @@
body {
background: blue;
}
+5
View File
@@ -0,0 +1,5 @@
$c: red;
body {
background: $c;
}