Skip to content

Commit

Permalink
Simplify test file reader
Browse files Browse the repository at this point in the history
  • Loading branch information
whscullin committed Oct 15, 2024
1 parent c11f1fa commit fc2015a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/utils/malloy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ import * as fs from 'fs';
import {Connection, Runtime} from '@malloydata/malloy';

export const compileMalloy = async (path: string, connection: Connection) => {
const srcURL = new URL(`model://${path}`);
const srcURL = new URL(`file://${path}`);
const fileReader = {
readURL: (url: URL) => {
return Promise.resolve(
fs.readFileSync(url.toString().replace('model://', ''), 'utf-8')
);
},
readURL: async (url: URL) => fs.readFileSync(url, 'utf-8'),
};
const runtime = new Runtime(fileReader, connection);
await runtime.getModel(srcURL);
Expand Down

0 comments on commit fc2015a

Please sign in to comment.