]> git.bitcoin.ninja Git - ldk-java/commitdiff
[TS] Change paths to liblightningjs.wasm to be in ts/
authorMatt Corallo <git@bluematt.me>
Mon, 10 Jan 2022 05:41:44 +0000 (05:41 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 10 Jan 2022 19:47:27 +0000 (19:47 +0000)
.github/workflows/build.yml
genbindings.sh
ts/test/browser.mjs
ts/test/index.html

index 334e106d287dae4e8d0f02d4854fecf5a449e35e..61e306ec77edb674ef126a723bb5b0362714d3a3 100644 (file)
@@ -50,7 +50,7 @@ jobs:
           # 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: |
@@ -63,9 +63,10 @@ jobs:
           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
index 25c8ffbe91c0b4774a4fb4051158ce33e703ecaa..5576b8dba3f17c93d7bf958aa02417de3dcbd60e 100755 (executable)
@@ -223,13 +223,12 @@ else
                        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
index fecaa3eccdd3f0d5f5d011f875a4defb9b33d0b2..03b5141415f860e53d4cdc9b31c1bfbdf0e1e086 100644 (file)
@@ -5,9 +5,9 @@ for (const browserType of [chromium, firefox]) { // We'd like to test webkit, bu
        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);
 
index 7c0027ebb4b1f80edb7891777c84f39eb22dbe5f..0467f91fb311daff74d66e551da8671676fefb57 100644 (file)
@@ -9,7 +9,7 @@
 <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 {