Skip to content

Commit

Permalink
style: tidy format of code
Browse files Browse the repository at this point in the history
1. format code of .html .js

2. clean some notes of code; remove duplicated eslint setup file; remove
non-english file

3. add eslint config and root:true in it

4. fix the format of .eslintrc.js

  Author:    cryptape.michael <michael@email.com>
  Date:      Wed Jun 22 16:16:19 2022 +0800
  • Loading branch information
cryptape@michael committed Jun 26, 2022
1 parent 4fa65de commit 5b70416
Show file tree
Hide file tree
Showing 42 changed files with 14,987 additions and 1,628 deletions.
2 changes: 1 addition & 1 deletion offchain-modules/tests/e2e/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
parserOptions: {
sourceType: "module",
},
root: true,
rules: {
indent: [
"error",
Expand All @@ -34,4 +35,3 @@ module.exports = {
],
},
};

1 change: 0 additions & 1 deletion offchain-modules/tests/e2e/CONTRIBUTING.md

This file was deleted.

202 changes: 0 additions & 202 deletions offchain-modules/tests/e2e/CONTRIBUTING_zh-Hans.md

This file was deleted.

6 changes: 4 additions & 2 deletions offchain-modules/tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

# before you start

run the process : force-bridge
start the process : force-bridge testnet

## run test case


```
cd force-bridge/offchain-modules/tests/e2e
mv config_demo.json config.json
cd force-bridge/offchain-modules/tests/e2e/src
yarn exec http-server
cd force-bridge/offchain-modules/tests/e2e/
yarn
yarn test
yarn e2e-test
```


35 changes: 1 addition & 34 deletions offchain-modules/tests/e2e/config.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
// import configSetting from "./config.json" assert {type: 'json'};
import configSetting from "./configDemo.json";

export default class Config {
constructor() {
this.watcherTestnetServer = "";
this.watcherBaseEndpoint = "";
this.ckbTestnetServer = "";
this.ckbMainnetServer = "";
this.localRpc = "";
this.localServer = "";
this.httpServer = "";

this.acount1 = "";
this.acount2 = "";
this.hexPrivateKey = "";
try {
// eslint-disable-next-line no-console
console.log("config info...");
this.watcherTestnetServer = configSetting.watcherTestnetServer;
this.watcherBaseEndpoint = configSetting.watcherBaseEndpoint;
this.ckbTestnetServer = configSetting.ckbTestnetServer;
this.ckbMainnetServer = configSetting.ckbMainnetServer;
this.localRpc = configSetting.localRpc;
this.localServer = configSetting.localServer;
this.httpServer = configSetting.httpServer;

this.hexPrivateKey = configSetting.hexPrivateKey;
this.acount1 = configSetting.acount1;
this.acount2 = configSetting.acount2;
} catch (err) {
// eslint-disable-next-line no-console
console.log("have config info error")
console.log(err);
throw err;
}
this.httpServer = "http://localhost:8080";
}

static getIns() {
Expand Down
13 changes: 0 additions & 13 deletions offchain-modules/tests/e2e/configDemo.json

This file was deleted.

10 changes: 0 additions & 10 deletions offchain-modules/tests/e2e/jest/setup.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import puppeteer from "puppeteer";
import { launch, setupMetamask, getMetamaskWindow } from "@chainsafe/dappeteer";

// import Config from "../config";
import createTransactionData from "../src/create_test_data/createTestDataManage";

export const DAPPETEER_DEFAULT_CONFIG = {
metamaskVersion: "v10.8.1",
args: [process.env.HEADLESS ? "--headless=chrome" : "", process.env.WSL ? "-no-sandbox" : ""],
};
export default async function setup() {
const browser = await launch(puppeteer, DAPPETEER_DEFAULT_CONFIG);
try {
await createTransactionData.resetTestTmpFiles();
// await createTransactionData.createTransactionData(); // create test data-- Returned error: Method not found
await setupMetamask(browser, {});
global.browser = browser;
} catch (error) {
Expand All @@ -25,11 +20,6 @@ export default async function setup() {
global.browser = browser;
global.metamask = await getMetamaskWindow(browser);

// await metamask.addNetwork({
// networkName: Config.getIns().axonRpc.netWorkName,
// rpc: Config.getIns().axonRpc.url,
// chainId: Config.getIns().axonRpc.chainId,
// });

const page = await browser.newPage();
await page.bringToFront();
Expand Down

0 comments on commit 5b70416

Please sign in to comment.