Skip to content

Commit 45b124c

Browse files
committed
Fix some issues
1 parent 704a701 commit 45b124c

File tree

7 files changed

+53
-13
lines changed

7 files changed

+53
-13
lines changed

packages/snaps-controllers/vitest.config.mts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ export default defineConfig({
2828
plugins: [tsconfigPaths(), nodePolyfills()],
2929

3030
server: {
31-
port: 63315,
32-
strictPort: true,
33-
3431
proxy: {
3532
'/iframe/executor': {
3633
target: `http://localhost:63315/@fs${IFRAME_PATH}`,

packages/snaps-execution-environments/src/proxy/ProxySnapExecutor.test.browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest';
44
import { ProxySnapExecutor } from './ProxySnapExecutor';
55

66
const MOCK_JOB_ID = 'job-id';
7-
const IFRAME_URL = 'http://localhost:63315/iframe/executor/index.html';
7+
const IFRAME_URL = 'http://localhost:63316/iframe/executor/index.html';
88

99
/**
1010
* Write a message to the stream, wrapped with the job ID and frame URL.

packages/snaps-execution-environments/src/webworker/pool/WebWorkerPool.test.browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { describe, expect, it } from 'vitest';
55
import { WebWorkerPool } from './WebWorkerPool';
66

77
const MOCK_JOB_ID = 'job-id';
8-
const WORKER_URL = 'http://localhost:63315/worker/executor/bundle.js';
8+
const WORKER_URL = 'http://localhost:63316/worker/executor/bundle.js';
99

1010
/**
1111
* Write a message to the stream, wrapped with the job ID.

packages/snaps-execution-environments/vitest.config.mts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,19 @@ export default defineConfig({
3737
},
3838

3939
server: {
40-
port: 63315,
41-
strictPort: true,
42-
4340
proxy: {
4441
'/iframe/executor': {
45-
target: `http://localhost:63315/@fs${IFRAME_PATH}`,
42+
target: `http://localhost:63316/@fs${IFRAME_PATH}`,
4643
rewrite: (path) => path.replace(/^\/iframe\/executor/u, ''),
4744
},
4845

4946
'/worker/executor': {
50-
target: `http://localhost:63315/@fs${WORKER_EXECUTOR_PATH}`,
47+
target: `http://localhost:63316/@fs${WORKER_EXECUTOR_PATH}`,
5148
rewrite: (path) => path.replace(/^\/worker\/executor/u, ''),
5249
},
5350

5451
'/worker/pool': {
55-
target: `http://localhost:63315/@fs${WORKER_POOL_PATH}`,
52+
target: `http://localhost:63316/@fs${WORKER_POOL_PATH}`,
5653
rewrite: (path) => path.replace(/^\/worker\/pool/u, ''),
5754
},
5855
},
@@ -72,6 +69,13 @@ export default defineConfig({
7269
// explicitly enabled with `yarn test:watch`.
7370
watch: false,
7471

72+
api: {
73+
// The port to use for the test server. This is used by the browser
74+
// provider to connect to the test server.
75+
port: 63316,
76+
strictPort: true,
77+
},
78+
7579
// The files to include in the test run.
7680
include: ['src/**/*.test.browser.ts'],
7781

packages/snaps-utils/src/iframe.test.browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, it, afterEach } from 'vitest';
22

33
import { createWindow } from './iframe';
44

5-
const IFRAME_URL = `http://localhost:4569`;
5+
const IFRAME_URL = 'http://localhost:63317/iframe/executor/index.html';
66

77
const MOCK_JOB_ID = 'job-id';
88

packages/snaps-utils/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
"compilerOptions": {
44
"baseUrl": "./"
55
},
6-
"include": ["./src", "scripts", "package.json", "vitest.config.mts", "vitest.config.firefox.mts"],
6+
"include": [
7+
"./src",
8+
"scripts",
9+
"package.json",
10+
"vitest.config.mts",
11+
"vitest.config.firefox.mts"
12+
],
713
"references": [{ "path": "../snaps-sdk" }]
814
}

packages/snaps-utils/vitest.config.mts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
1+
// eslint-disable-next-line import-x/no-nodejs-modules
2+
import { join } from 'path';
13
import { nodePolyfills } from 'vite-plugin-node-polyfills';
24
import tsconfigPaths from 'vite-tsconfig-paths';
35
import { defineConfig } from 'vitest/config';
46

7+
const IFRAME_PATH = join(import.meta.dirname, './dist/browserify/iframe');
8+
59
export default defineConfig({
610
plugins: [tsconfigPaths(), nodePolyfills()],
711

12+
optimizeDeps: {
13+
include: [
14+
'vite-plugin-node-polyfills/shims/buffer',
15+
'vite-plugin-node-polyfills/shims/global',
16+
'vite-plugin-node-polyfills/shims/process',
17+
],
18+
},
19+
20+
server: {
21+
proxy: {
22+
'/iframe/executor': {
23+
target: `http://localhost:63317/@fs${IFRAME_PATH}`,
24+
rewrite: (path) => path.replace(/^\/iframe\/executor/u, ''),
25+
},
26+
},
27+
28+
fs: {
29+
strict: true,
30+
allow: ['../snaps-execution-environments/dist/browserify/iframe'],
31+
},
32+
},
33+
834
test: {
935
// Vitest enables watch mode by default. We disable it here, so it can be
1036
// explicitly enabled with `yarn test:watch`.
1137
watch: false,
1238

39+
api: {
40+
// The port to use for the test server. This is used by the browser
41+
// provider to connect to the test server.
42+
port: 63317,
43+
strictPort: true,
44+
},
45+
1346
// The files to include in the test run.
1447
include: ['src/**/*.test.browser.ts'],
1548

0 commit comments

Comments
 (0)