Skip to content

Commit cf223fb

Browse files
authored
dev: Upgrade to use [email protected] (#11901)
Remove angular dep of 1.4.0 -- I'd like to move replay's tests over to vitest.
1 parent dd5c170 commit cf223fb

File tree

6 files changed

+136
-244
lines changed

6 files changed

+136
-244
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"@types/jsdom": "^21.1.6",
104104
"@types/node": "^14.18.0",
105105
"@types/rimraf": "^3.0.2",
106-
"@vitest/coverage-c8": "^0.29.2",
106+
"@vitest/coverage-v8": "^1.6.0",
107107
"codecov": "^3.6.5",
108108
"deepmerge": "^4.2.2",
109109
"downlevel-dts": "~0.11.0",
@@ -127,7 +127,7 @@
127127
"ts-node": "10.9.1",
128128
"typedoc": "^0.18.0",
129129
"typescript": "4.9.5",
130-
"vitest": "^0.29.2",
130+
"vitest": "^1.6.0",
131131
"yalc": "^1.0.0-pre.53"
132132
},
133133
"resolutions": {

packages/angular/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"ng-packagr": "^14.2.2",
4141
"rxjs": "7.8.1",
4242
"typescript": "4.6.4",
43-
"vitest": "^1.4.0",
4443
"zone.js": "^0.12.0"
4544
},
4645
"scripts": {

packages/astro/test/integration/snippets.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('buildClientSnippet', () => {
1515
it('returns a basic Sentry init call with default options', () => {
1616
const snippet = buildClientSnippet({});
1717
expect(snippet).toMatchInlineSnapshot(`
18-
"import * as Sentry from \\"@sentry/astro\\";
18+
"import * as Sentry from "@sentry/astro";
1919
2020
Sentry.init({
2121
dsn: import.meta.env.PUBLIC_SENTRY_DSN,
@@ -34,13 +34,13 @@ describe('buildClientSnippet', () => {
3434
const snippet = buildClientSnippet(allSdkOptions);
3535

3636
expect(snippet).toMatchInlineSnapshot(`
37-
"import * as Sentry from \\"@sentry/astro\\";
37+
"import * as Sentry from "@sentry/astro";
3838
3939
Sentry.init({
40-
dsn: \\"my-dsn\\",
40+
dsn: "my-dsn",
4141
debug: true,
42-
environment: \\"staging\\",
43-
release: \\"1.0.0\\",
42+
environment: "staging",
43+
release: "1.0.0",
4444
tracesSampleRate: 0.3,
4545
sampleRate: 0.2,
4646
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
@@ -53,7 +53,7 @@ describe('buildClientSnippet', () => {
5353
it('does not include browserTracingIntegration if tracesSampleRate is 0', () => {
5454
const snippet = buildClientSnippet({ tracesSampleRate: 0 });
5555
expect(snippet).toMatchInlineSnapshot(`
56-
"import * as Sentry from \\"@sentry/astro\\";
56+
"import * as Sentry from "@sentry/astro";
5757
5858
Sentry.init({
5959
dsn: import.meta.env.PUBLIC_SENTRY_DSN,
@@ -72,7 +72,7 @@ describe('buildClientSnippet', () => {
7272
it('does not include Replay if replay sample ratest are 0', () => {
7373
const snippet = buildClientSnippet({ replaysSessionSampleRate: 0, replaysOnErrorSampleRate: 0 });
7474
expect(snippet).toMatchInlineSnapshot(`
75-
"import * as Sentry from \\"@sentry/astro\\";
75+
"import * as Sentry from "@sentry/astro";
7676
7777
Sentry.init({
7878
dsn: import.meta.env.PUBLIC_SENTRY_DSN,
@@ -91,7 +91,7 @@ describe('buildServerSnippet', () => {
9191
it('returns a basic Sentry init call with default options', () => {
9292
const snippet = buildServerSnippet({});
9393
expect(snippet).toMatchInlineSnapshot(`
94-
"import * as Sentry from \\"@sentry/astro\\";
94+
"import * as Sentry from "@sentry/astro";
9595
9696
Sentry.init({
9797
dsn: import.meta.env.PUBLIC_SENTRY_DSN,
@@ -107,13 +107,13 @@ describe('buildServerSnippet', () => {
107107
const snippet = buildServerSnippet(allSdkOptions);
108108

109109
expect(snippet).toMatchInlineSnapshot(`
110-
"import * as Sentry from \\"@sentry/astro\\";
110+
"import * as Sentry from "@sentry/astro";
111111
112112
Sentry.init({
113-
dsn: \\"my-dsn\\",
113+
dsn: "my-dsn",
114114
debug: true,
115-
environment: \\"staging\\",
116-
release: \\"1.0.0\\",
115+
environment: "staging",
116+
release: "1.0.0",
117117
tracesSampleRate: 0.3,
118118
sampleRate: 0.2,
119119
});"

packages/sveltekit/.empty.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Hack to get $app/stores import working (can't mock it in tests if path is not resolvable).
2+
// See: https://github.com/vitest-dev/vitest/issues/4630

packages/sveltekit/vite.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { dirname, resolve } from 'path';
2+
import { fileURLToPath } from 'url';
3+
14
import type { UserConfig } from 'vitest';
25

36
import baseConfig from '../../vite/vite.config';
@@ -10,5 +13,11 @@ export default {
1013
...(baseConfig as UserConfig & { test: any }).test,
1114
environment: 'jsdom',
1215
setupFiles: ['./test/vitest.setup.ts'],
16+
alias: [
17+
{
18+
find: '$app/stores',
19+
replacement: resolve(fileURLToPath(dirname(import.meta.url)), '/.empty.js'),
20+
},
21+
],
1322
},
1423
};

0 commit comments

Comments
 (0)