# Thus, we install the binary nodejs from nodejs.org and test with that.
curl https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz > nodejs.tar.xz
tar xvvf nodejs.tar.xz
- export PATH=$(echo node-*/bin):$PATH
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
./genbindings.sh ./ldk-c-bindings/ wasm false false
- name: Build and Test TS Bindings for Web
run: |
mkdir -p $HOME/.cache/ms-playwright # `playwright install` is too dumb to create this for us
chmod -R 777 $HOME/
npx playwright install
- export PATH=$(echo node-*/bin):$PATH
+ export PATH=$(pwd)/$(echo node-*/bin):$PATH
+ cd ts
python3 -m http.server &
- node ts/test/browser.mjs
+ node test/browser.mjs
- name: Check latest TS files are in git
run: |
git diff --exit-code
tsc
else
tsc --types node --typeRoots .
- cd ..
if [ -x "$(which node)" ]; then
NODE_V="$(node --version)"
if [ "${NODE_V:1:2}" -gt 14 ]; then
rm -f liblightningjs.wasm
- ln -s $WASM_FILE liblightningjs.wasm
- node ts/test/node.mjs
+ ln -s "$(pwd)"/../$WASM_FILE liblightningjs.wasm
+ node test/node.mjs
fi
fi
fi
const browser = await browserType.launch();
const context = await browser.newContext();
const page = await context.newPage();
- await page.goto('http://localhost:8000/ts/test/index.html');
+ await page.goto('http://localhost:8000/test/index.html');
const ret = await page.evaluate(() => {
- return test_runner('../../liblightningjs.wasm');
+ return test_runner('../liblightningjs.wasm');
});
assert(ret);
<script type="module">
import { run_tests } from './tests.mjs';
try {
- const result = run_tests('../../liblightningjs.wasm');
+ const result = run_tests('../liblightningjs.wasm');
if (result) {
document.getElementById("results").innerHTML = "All Tests Passed (note free-time errors may still occurr)!";
} else {