update typescript and fix test cases
This commit is contained in:
@@ -48,6 +48,6 @@
|
|||||||
"ts-node": "^7.0.1",
|
"ts-node": "^7.0.1",
|
||||||
"tslib": "^1.9.3",
|
"tslib": "^1.9.3",
|
||||||
"tslint": "^4.5.1",
|
"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 typescript = require('rollup-plugin-typescript');
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai';
|
||||||
import { SnapshotState, toMatchSnapshot } from 'jest-snapshot';
|
import { SnapshotState, toMatchSnapshot } from 'jest-snapshot';
|
||||||
|
import { Suite } from 'mocha';
|
||||||
|
|
||||||
const htmlFolder = path.join(__dirname, 'html');
|
const htmlFolder = path.join(__dirname, 'html');
|
||||||
const htmls = fs.readdirSync(htmlFolder).map(filePath => {
|
const htmls = fs.readdirSync(htmlFolder).map(filePath => {
|
||||||
@@ -23,7 +24,7 @@ interface IMimeType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const server = () =>
|
const server = () =>
|
||||||
new Promise(resolve => {
|
new Promise<http.Server>(resolve => {
|
||||||
const mimeType: IMimeType = {
|
const mimeType: IMimeType = {
|
||||||
'.html': 'text/html',
|
'.html': 'text/html',
|
||||||
'.js': 'text/javascript',
|
'.js': 'text/javascript',
|
||||||
@@ -66,7 +67,13 @@ function matchSnapshot(actual: string, testFile: string, testTitle: string) {
|
|||||||
return result;
|
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 () => {
|
before(async () => {
|
||||||
this.server = await server();
|
this.server = await server();
|
||||||
this.browser = await puppeteer.launch({
|
this.browser = await puppeteer.launch({
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ describe('absolute url to stylesheet', () => {
|
|||||||
href,
|
href,
|
||||||
),
|
),
|
||||||
).to.equal(
|
).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;`,
|
`background: #aabbcc url('http://localhost/css/images/a.jpg') 50% 50% repeat;`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user