build: run playground e2e examples with bazel (#28697)

PR Close #28697
This commit is contained in:
Paul Gschwendtner
2019-02-01 14:46:38 +01:00
committed by Miško Hevery
parent 866f4be782
commit c1c68889de
42 changed files with 265 additions and 32 deletions

View File

@ -0,0 +1,11 @@
load("//modules/playground/e2e_test:example_test.bzl", "example_test")
example_test(
name = "sourcemap",
srcs = glob(["**/*.ts"]),
data = [
"//modules/playground/src/sourcemap",
"//modules/playground/src/sourcemap:index.ts",
],
server = "//modules/playground/src/sourcemap:devserver",
)

View File

@ -13,7 +13,7 @@ const fs = require('fs');
const sourceMap = require('source-map');
describe('sourcemaps', function() {
const URL = 'all/playground/src/sourcemap/index.html';
const URL = '/';
it('should map sources', function() {
browser.get(URL);
@ -36,7 +36,7 @@ describe('sourcemaps', function() {
const content =
fs.readFileSync('dist/all/playground/src/sourcemap/index.js').toString('utf8');
fs.readFileSync(require.resolve('../../src/sourcemap/index.js')).toString('utf8');
const marker = '//# sourceMappingURL=data:application/json;base64,';
const index = content.indexOf(marker);
const sourceMapData =
@ -46,7 +46,7 @@ describe('sourcemaps', function() {
const originalPosition = decoder.originalPositionFor({line: errorLine, column: errorColumn});
const sourceCodeLines = fs.readFileSync('modules/playground/src/sourcemap/index.ts', {
const sourceCodeLines = fs.readFileSync(require.resolve('../../src/sourcemap/index.ts'), {
encoding: 'UTF-8'
}).split('\n');
expect(sourceCodeLines[originalPosition.line - 1])