Skip to content

Commit

Permalink
fix: unit tests compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
RSamaium committed Jan 28, 2024
1 parent f61a24c commit 1292365
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/compiler/src/build/client-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export async function clientBuildConfig(dirname: string, options: ClientBuildCon

let serverUrl = ''

serverUrl = env.VITE_SERVER_URL = process.env.VITE_SERVER_URL ?? buildOptions?.serverUrl ?? ''
let envServerUrl = process.env.VITE_SERVER_URL
if (envServerUrl && !envServerUrl.startsWith('http')) {
process.env.VITE_SERVER_URL = envServerUrl = `http://${envServerUrl}`
}
serverUrl = env.VITE_SERVER_URL = envServerUrl ?? buildOptions?.serverUrl ?? ''

if (options.mode != 'test' && !plugin && !libMode) {
// if index.html is not found, display an error
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/build/vite-plugin-config.toml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function loadServerFiles(modulePath: string, options, config) {
const eventsFilesString = searchFolderAndTransformToImportString('events', modulePath, '.ts')
const hitbox = config.start?.hitbox

const verifyDefaultExport = (importObject: ImportObject) => `
const verifyDefaultExport = (importObject: ImportObject) => dd`
[${importObject?.variablesString}].map((val) => {
if (!val) {
throw new Error('Do you have "export default" in this file ? : ${importObject?.relativePath}')
Expand Down
1 change: 1 addition & 0 deletions packages/compiler/tests/toml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ describe('TOML Configuration test', () => {
expect(result).toEqual({
variablesString: '',
importString: '',
relativePath: '',
folder: '',
})
})
Expand Down

0 comments on commit 1292365

Please sign in to comment.