update typescript and fix test cases
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<http.Server>(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({
|
||||
|
||||
@@ -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;`,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user