Skip to content

Commit

Permalink
configure puppeteer and gitpod
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1504 committed Jul 16, 2020
1 parent 1498dc4 commit 5c5f518
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:12

RUN apt-get update && \
apt-get -y install xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \
libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 \
libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \
libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget && \
rm -rf /var/lib/apt/lists/*
4 changes: 4 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
image:
file: .gitpod.dockerfile
tasks:
- command: npm install
5 changes: 5 additions & 0 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
launch: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
}
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'jest-puppeteer',
testRegex: './*\\.test\\.js$'
}
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Web based viewer",
"main": "index.js",
"scripts": {
"test": "npm run lint",
"test": "jest --verbose",
"pretest": "npm run lint",
"lint": "standard",
"fix": "standard --fix"
},
Expand All @@ -25,7 +26,11 @@
"vec3": "^0.1.5"
},
"devDependencies": {
"standard": "^14.3.4",
"mineflayer": "^2.23.0"
"jest": "^26.1.0",
"jest-puppeteer": "^4.4.0",
"minecraft-wrap": "^1.2.3",
"mineflayer": "^2.23.0",
"puppeteer": "^5.1.0",
"standard": "^14.3.4"
}
}
12 changes: 12 additions & 0 deletions test/simple.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-env jest */
/* global page */

describe('Google', () => {
beforeAll(async () => {
await page.goto('https://google.com')
})

it('should display "google" text on page', async () => {
await expect(page).toMatch('google')
})
})

0 comments on commit 5c5f518

Please sign in to comment.