From 6b7342cbd6eedfb290d696af10eb253b95de9399 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Thu, 11 Aug 2022 14:44:37 -0300 Subject: [PATCH] fix(source-maps): adjusted error line and made variables more descritive --- tools/tests/source-maps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/tests/source-maps.js b/tools/tests/source-maps.js index bdde3ef793..dc6d948db7 100644 --- a/tools/tests/source-maps.js +++ b/tools/tests/source-maps.js @@ -1,7 +1,6 @@ var selftest = require('../tool-testing/selftest.js'); var Sandbox = selftest.Sandbox; var files = require('../fs/files'); -var catalog = require('../packaging/catalog/catalog.js'); function matchPath (text, doubleBS) { if (process.platform === 'win32') { @@ -17,9 +16,11 @@ selftest.define("source maps from checkout", ['checkout'], function () { try { throw new Error(); } catch (e) { + // this refers to the line number where the error is thrown + const errorLine = "17"; var index = (process.platform === 'win32') ? 2 : 1; const sourceMap = e.stack.split(":")[index]; - const result = (sourceMap === "17" || sourceMap === "18"); + const result = (sourceMap === errorLine); selftest.expectEqual(result, true); } });