Skip to content

Commit

Permalink
test: update unit test assertions for StripProjectRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag committed Apr 10, 2024
1 parent cae77d3 commit aaf5107
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/transformers/__test__/StripProjectRoot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test('StripProjectRoot transformer: typescript example', async () => {
const sourceMapJson = JSON.parse(await fs.readFile(absolutePath, 'utf-8'))
await StripProjectRoot(absolutePath, sourceMapJson, projectRoot, noopLogger)
expect(sourceMapJson.sources).toStrictEqual([
path.join('lib', 'a.ts'),
'lib/a.ts',
'index.ts'
])
})
Expand All @@ -26,7 +26,7 @@ test('StripProjectRoot transformer: webpack example', async () => {
const sourceMapJson = JSON.parse(await fs.readFile(absolutePath, 'utf-8'))
await StripProjectRoot(absolutePath, sourceMapJson, projectRoot, noopLogger)
expect(sourceMapJson.sources).toStrictEqual([
path.join('lib', 'a.js'),
'lib/a.js',
'webpack:https:///webpack/bootstrap',
'index.js'
])
Expand All @@ -38,7 +38,7 @@ test('StripProjectRoot transformer: webpack example (synthetic sections)', async
const sourceMapJson = { sections: [ { map: JSON.parse(await fs.readFile(absolutePath, 'utf-8')) } ] }
await StripProjectRoot(absolutePath, sourceMapJson, projectRoot, noopLogger)
expect(sourceMapJson.sections[0].map.sources).toStrictEqual([
path.join('lib', 'a.js'),
'lib/a.js',
'webpack:https:///webpack/bootstrap',
'index.js'
])
Expand All @@ -50,7 +50,7 @@ test('StripProjectRoot transformer: webpack example with namespace', async () =>
const sourceMapJson = { sections: [ { map: JSON.parse(await fs.readFile(absolutePath, 'utf-8')) } ] }
await StripProjectRoot(absolutePath, sourceMapJson, projectRoot, noopLogger)
expect(sourceMapJson.sections[0].map.sources).toStrictEqual([
path.join('lib', 'a.js'),
'lib/a.js',
'webpack:https://this-package-name-is-used-in-the-source-paths/webpack/bootstrap',
'index.js'
])
Expand All @@ -62,7 +62,7 @@ test('StripProjectRoot transformer: preserves path separators (posix)', async ()
const sourceMapJson = JSON.parse(await fs.readFile(absolutePath, 'utf-8'))
await StripProjectRoot(absolutePath, sourceMapJson, projectRoot, noopLogger)
expect(sourceMapJson.sources).toStrictEqual([
path.join('lib/a.ts'),
'lib/a.ts',
'index.ts'
])
})
Expand All @@ -73,7 +73,7 @@ test('StripProjectRoot transformer: preserves path separators (windows)', async
const sourceMapJson = JSON.parse(await fs.readFile(absolutePath, 'utf-8'))
await StripProjectRoot(absolutePath, sourceMapJson, projectRoot, noopLogger)
expect(sourceMapJson.sources).toStrictEqual([
path.join('lib\\a.ts'),
'lib\\a.ts',
'index.ts'
])
})

0 comments on commit aaf5107

Please sign in to comment.