Skip to content

Commit

Permalink
chore: use npm pack in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Nov 26, 2024
1 parent 5421c6f commit 369cbd6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_modules
site
.testdir
build
.venv
.venv
aeternity-aeproject-*.tgz
1 change: 0 additions & 1 deletion src/init/next-artifacts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.6"
services:
aeproject_node:
image: aeternity/aeternity:${NODE_TAG:-latest}-bundle
Expand Down
13 changes: 7 additions & 6 deletions tests/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export function cleanLocal() {
if (fs.existsSync(cwd)) fs.rmSync(cwd, { recursive: true });
}

let isPacked = false;

export async function linkLocalLib(folder) {
const c = folder ? path.join(cwd, folder) : cwd;
await exec("npm i .. -D", { cwd: c });
await exec(
'perl -i -pe \'s/"prepare"/"rem-prepare"/g\' ../node_modules/@aeternity/aepp-sdk/package.json',
{ cwd: c },
);
await exec("npm i ../node_modules/@aeternity/aepp-sdk", { cwd: c });
if (!isPacked) {
await exec("npm pack --ignore-scripts");
isPacked = true;
}
await exec(`npm i ${path.join(process.cwd(), "aeternity-aeproject-4.10.2.tgz")} -D`, { cwd: c });
}

0 comments on commit 369cbd6

Please sign in to comment.