diff --git a/package.json b/package.json index 2eb6e1d4..b4164ed9 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,6 @@ "ts-node": "^7.0.1", "tslib": "^1.9.3", "tslint": "^4.5.1", - "typescript": "^3.0.3" + "typescript": "^3.4.1" } } diff --git a/test/integration.ts b/test/integration.ts index 387b7ee7..8edcebee 100644 --- a/test/integration.ts +++ b/test/integration.ts @@ -8,6 +8,7 @@ import * as rollup from 'rollup'; import typescript = require('rollup-plugin-typescript'); import { assert } from 'chai'; import { SnapshotState, toMatchSnapshot } from 'jest-snapshot'; +import { Suite } from 'mocha'; const htmlFolder = path.join(__dirname, 'html'); const htmls = fs.readdirSync(htmlFolder).map(filePath => { @@ -23,7 +24,7 @@ interface IMimeType { } const server = () => - new Promise(resolve => { + new Promise(resolve => { const mimeType: IMimeType = { '.html': 'text/html', '.js': 'text/javascript', @@ -66,7 +67,13 @@ function matchSnapshot(actual: string, testFile: string, testTitle: string) { return result; } -describe('integration tests', () => { +interface ISuite extends Suite { + server: http.Server; + browser: puppeteer.Browser; + code: string; +} + +describe('integration tests', function(this: ISuite) { before(async () => { this.server = await server(); this.browser = await puppeteer.launch({ diff --git a/test/snapshot.test.ts b/test/snapshot.test.ts index 9a29018d..c2f736f9 100644 --- a/test/snapshot.test.ts +++ b/test/snapshot.test.ts @@ -54,7 +54,7 @@ describe('absolute url to stylesheet', () => { href, ), ).to.equal( - `background-image: url('http://localhost/css/images/b.jpg'); ` + + `background-image: url('http://localhost/css/images/b.jpg');` + `background: #aabbcc url('http://localhost/css/images/a.jpg') 50% 50% repeat;`, ); });