From 037ffbba5928d858115c4e4c02eb71ba230753ca Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Sun, 4 Sep 2022 04:09:18 +0000 Subject: [PATCH] tests: remove `source-map` from `js-api-tests` --- scripts/js-api-tests.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/js-api-tests.js b/scripts/js-api-tests.js index 581f7978abd..38220869c2a 100644 --- a/scripts/js-api-tests.js +++ b/scripts/js-api-tests.js @@ -1,5 +1,4 @@ const { installForTests, removeRecursiveSync, writeFileAtomic } = require('./esbuild') -const { SourceMapConsumer } = require('source-map') const assert = require('assert') const path = require('path') const http = require('http') @@ -5629,11 +5628,11 @@ ${path.relative(process.cwd(), input).replace(/\\/g, '/')}:1:2: ERROR: Unexpecte } async function assertSourceMap(jsSourceMap, source) { - const map = await new SourceMapConsumer(jsSourceMap) - const original = map.originalPositionFor({ line: 1, column: 4 }) - assert.strictEqual(original.source, source) - assert.strictEqual(original.line, 1) - assert.strictEqual(original.column, 10) + jsSourceMap = JSON.parse(jsSourceMap) + assert.deepStrictEqual(jsSourceMap.version, 3) + assert.deepStrictEqual(jsSourceMap.sources, [source]) + assert.deepStrictEqual(jsSourceMap.sourcesContent, ['let x']) + assert.deepStrictEqual(jsSourceMap.mappings, 'AAAA,IAAU;') } async function main() {