chore: fix build [fixes DXJ-482] (#352)

* Remove additional node targeted build

* Fix test errors

* Typo fix

* Remove headless

* Prevent JSON error

* Cache json parsing

* Remove resource test as it's not working in new nox

* Fix test output

* enable smoke tests

* add puppeteer to deps

* Remove headless option
This commit is contained in:
Akim
2023-09-29 16:23:06 +07:00
committed by GitHub
parent 63e4ce3f84
commit 15a2c91917
22 changed files with 414 additions and 706 deletions

View File

@ -53,15 +53,6 @@ export const runTest = async (): Promise<TestResult> => {
console.log('my peer id: ', client.getPeerId());
console.log('my sk id: ', fromByteArray(client.getPeerSecretKey()));
console.log('running resource test...');
const [res, errors] = await resourceTest('my_resource');
if (res === null) {
console.log('resource test failed, errors', errors);
return { type: 'failure', error: errors.join(', ') };
} else {
console.log('resource test finished, result', res);
}
console.log('running hello test...');
const hello = await helloTest();
console.log('hello test finished, result: ', hello);
@ -75,9 +66,8 @@ export const runTest = async (): Promise<TestResult> => {
console.log('marine test finished, result: ', marine);
const returnVal = {
res,
hello,
// marine,
marine,
};
return { type: 'success', data: JSON.stringify(returnVal) };
} finally {

View File

@ -11,7 +11,7 @@
"type": "module",
"scripts": {
"build": "tsc",
"test_commented_out": "node --loader ts-node/esm ./src/index.ts"
"test": "node --loader ts-node/esm ./src/index.ts"
},
"repository": "https://github.com/fluencelabs/fluence-js",
"author": "Fluence Labs",

View File

@ -19,10 +19,11 @@
"web-vitals": "2.1.4"
},
"devDependencies": {
"@test/test-utils": "workspace:^"
"@test/test-utils": "workspace:^",
"puppeteer": "19.7.2"
},
"scripts": {
"test_commented_out": "node --loader ts-node/esm ./test/index.ts",
"test": "node --loader ts-node/esm ./test/index.ts",
"simulate-cdn": "http-server -p 8766 ../../../client/js-client.web.standalone/dist",
"start": "react-scripts start",
"build": "react-scripts build",

View File

@ -19,7 +19,7 @@ const test = async () => {
}
console.log('starting puppeteer...');
const browser = await puppeteer.launch({ headless: false });
const browser = await puppeteer.launch();
const page = (await browser.pages())[0];
// uncomment to debug what's happening inside the browser

View File

@ -12,7 +12,7 @@
"scripts": {
"build": "tsc",
"simulate-cdn": "http-server -p 8765 ../../../client/js-client.web.standalone/dist",
"test_commented_out": "node --loader ts-node/esm ./src/index.ts",
"test": "node --loader ts-node/esm ./src/index.ts",
"serve": "http-server public"
},
"repository": "https://github.com/fluencelabs/fluence-js",
@ -22,5 +22,7 @@
"@fluencelabs/js-client": "workspace:^",
"@test/test-utils": "workspace:../../test-utils"
},
"devDependencies": {}
"devDependencies": {
"puppeteer": "19.7.2"
}
}