Skip to content

Commit 9fca7f1

Browse files
committed
Update devserver vite configuration to include missing optimizeDeps
1 parent b8b3693 commit 9fca7f1

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

devserver/src/components/__tests__/Playground.tsx renamed to devserver/src/components/__tests__/Playground.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ describe('Playground tests', () => {
2020
await commands.setLocalStorage('editorValue', '');
2121
});
2222

23-
const clickRunButton = (component: RenderResult) => {
23+
function clickRunButton(component: RenderResult) {
2424
const runButton = component.getByRole('button', { name: 'run' });
2525
return userEvent.click(runButton);
26-
};
26+
}
2727

2828
test('Running js-slang by clicking the run button', async () => {
2929
const component = await render(<Playground />);

devserver/vite.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineProject(({ mode }) => {
3131
// resolveId(source) {
3232
// const RE = /^@sourceacademy\/bundle-.+(?:$|\/(.+)$)/
3333
// const match = RE.exec(source);
34-
34+
3535
// if (source.startsWith('@sourceacademy')) {
3636
// console.log('trying to resolve', source)
3737
// }
@@ -68,7 +68,7 @@ export default defineProject(({ mode }) => {
6868
try {
6969
await fs.access(`${newSource}${each}`, fs.constants.R_OK)
7070
return `${newSource}${each}`
71-
} catch {}
71+
} catch { }
7272
}
7373

7474
return undefined;
@@ -87,6 +87,8 @@ export default defineProject(({ mode }) => {
8787
},
8888
include: [
8989
'../build/tabs/*.js',
90+
'@blueprintjs/core',
91+
'@blueprintjs/icons',
9092
'ace-builds',
9193
'ace-builds/src-noconflict/ace',
9294
'ace-builds/src-noconflict/ext-language_tools',
@@ -96,6 +98,7 @@ export default defineProject(({ mode }) => {
9698
'js-slang/dist/createContext',
9799
'js-slang/dist/editors/ace/modes/source',
98100
'js-slang/dist/editors/ace/theme/source',
101+
'js-slang/dist/modules/loader',
99102
'js-slang/dist/types',
100103
'js-slang/dist/utils/stringify',
101104
'react/jsx-dev-runtime',
@@ -105,12 +108,13 @@ export default defineProject(({ mode }) => {
105108
"vite-plugin-node-polyfills/shims/buffer",
106109
"vite-plugin-node-polyfills/shims/global",
107110
"vite-plugin-node-polyfills/shims/process",
111+
'vitest-browser-react'
108112
],
109113
},
110114
test: {
111115
root: import.meta.dirname,
112116
name: 'Dev Server',
113-
include: ['**/__tests__/**/*.{ts,tsx}'],
117+
include: ['**/__tests__/**/*.test.{ts,tsx}'],
114118
browser: {
115119
enabled: true,
116120
provider: playwright(),

0 commit comments

Comments
 (0)