Skip to content

Commit

Permalink
Merge pull request #19 from Batterii/VU-1075
Browse files Browse the repository at this point in the history
Vu-1075 allow parsing ts files
  • Loading branch information
jroell authored Jul 5, 2023
2 parents f0ec7de + a712d0c commit 641b010
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/fixture-riveter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ export class FixtureRiveter {
await Promise.all(filepaths.map((filepath) => import(filepath)));
}

/* When using loader: ts-node/esm */
async loadFixturesTs(directory = "."): Promise<void> {
const filepaths = await fg(
resolve(".", `${directory}/fixtures/**/*.ts}`),
{onlyFiles: true},
);

await Promise.all(filepaths.map((filepath) => import(filepath)));
}

async cleanUp(): Promise<void> {
const {instances} = this;
instances.reverse();
Expand Down

0 comments on commit 641b010

Please sign in to comment.