Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jtenner committed Jun 22, 2021
1 parent c55c3d8 commit e967072
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,22 +378,30 @@ export function run(cliOptions: Options, compilerArgs: string[]): void {

// If another extension is used create copy of assembly/**/*.ts files
if (flags["--extension"]) {
console.log(chalk`{bgWhite.black [Log]} Changing extension for injected assembly files`);
console.log(
chalk`{bgWhite.black [Log]} Changing extension for injected assembly files`,
);
const newExt = flags["--extension"][0].replace(".", ""); // without dot should work
const assemblyFolder = path.dirname(require.resolve("@as-pect/assembly/assembly/index.ts"));
const assemblyFolder = path.dirname(
require.resolve("@as-pect/assembly/assembly/index.ts"),
);

const files = glob.sync(path.join(assemblyFolder, "**/*.ts"));

files.forEach(file => {
files.forEach((file) => {
const dirname = path.dirname(file);
const basename = path.basename(file, path.extname(file));
fs.copyFileSync(file, path.join(dirname, basename + "." + newExt));
});
}

// must include the assembly/index.ts file located in the assembly package
const entryExt = !flags["--extension"] ? "ts" : flags["--extension"][0].replace(".", "");
const entryPath = require.resolve("@as-pect/assembly/assembly/index." + entryExt);
const entryExt = !flags["--extension"]
? "ts"
: flags["--extension"][0].replace(".", "");
const entryPath = require.resolve(
"@as-pect/assembly/assembly/index." + entryExt,
);
const relativeEntryPath = path.relative(process.cwd(), entryPath);

// add the relativeEntryPath of as-pect to the list of compiled files for each test
Expand Down

0 comments on commit e967072

Please sign in to comment.