-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(browser): Remove webpack build tests (#12967)
Removes `packages/browser/test/package/npm-build.js`. `packages/browser/test/package/npm-build.js` contained three tests: 1. Test against `tslib_1__default` appearing in the bundle. I added a browser integration test to replicate this 2. Test that adding a bundled package would work, our integration + e2e tests pretty much cover this 3. Test that you can add bundle packages multiple times - our integration + e2e tests also cover this I also migrated `packages/utils/test/types/index.js` to use jest instead of a plain script.
- Loading branch information
1 parent
6027036
commit 789231c
Showing
9 changed files
with
89 additions
and
1,227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
dev-packages/browser-integration-tests/suites/public-api/init/built-pkg/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
|
||
import { expect } from '@playwright/test'; | ||
|
||
import { sentryTest } from '../../../../utils/fixtures'; | ||
|
||
// Regression test against https://github.com/getsentry/sentry-javascript/pull/1896 | ||
sentryTest('should not contain tslib_1__default', async ({ getLocalTestPath }) => { | ||
await getLocalTestPath({ testDir: __dirname }); | ||
|
||
const initBundle = fs.readFileSync(path.join(__dirname, 'dist', 'init.bundle.js'), 'utf-8'); | ||
expect(initBundle.length).toBeGreaterThan(0); | ||
expect(initBundle).not.toContain('tslib_1__default'); | ||
|
||
const subjectBundle = fs.readFileSync(path.join(__dirname, 'dist', 'subject.bundle.js'), 'utf-8'); | ||
expect(subjectBundle.length).toBeGreaterThan(0); | ||
expect(subjectBundle).not.toContain('tslib_1__default'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
|
||
const testStrings = ['/// <reference types="node" />']; | ||
|
||
const paths = [path.join('./build/cjs'), path.join('./build/esm')]; | ||
|
||
test('typedef', () => { | ||
paths.forEach(dir => { | ||
if (!fs.existsSync(dir)) { | ||
throw new Error(`${dir} doesn't exist please build first`); | ||
} | ||
const files = fs.readdirSync(dir); | ||
files.forEach(file => { | ||
if (file.includes('.d.ts')) { | ||
testStrings.forEach(testString => { | ||
const filePath = path.join(dir, file); | ||
if (fs.readFileSync(filePath, 'utf8').includes(testString)) { | ||
throw new Error(`${filePath} contains types`); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.