Skip to content

Commit

Permalink
try hack teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Sep 15, 2024
1 parent 7b3ecda commit 4a822bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion e2e-examples/cli-e2e-original/setup/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {

const isVerbose = process.env['NX_VERBOSE_LOGGING'] === 'true' ?? false;
const projectName = process.env['NX_TASK_TARGET_PROJECT'];
let stopFn: () => void

export async function setup() {
if (projectName == null) {
Expand Down Expand Up @@ -44,15 +45,22 @@ export async function setup() {
targets: 'original-npm-install',
exclude: 'tag:type:testing',
skipNxCache: true,
parallel: 1,
verbose: isVerbose
}),
verbose: isVerbose
});

// @TODO figure out why named exports don't work https://vitest.dev/config/#globalsetup
return () => teardownSetup(registryResult);
stopFn = () => teardownSetup(registryResult)
return () => stopFn();
}



export async function teardown() {
stopFn()
}
export async function teardownSetup({ registry, stop }: RegistryResult) {
console.info(`Teardown ${projectName}`);
// uninstall all projects
Expand Down

0 comments on commit 4a822bd

Please sign in to comment.