Skip to content

Commit

Permalink
feat: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
metallicalfa2 committed Feb 25, 2022
1 parent 13da9cb commit bea3c3a
Show file tree
Hide file tree
Showing 9 changed files with 902 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"],
"extension": ["ts", "js"],
"require" : "./tests/mochasetup.js",
"require" : "./tests/setup.js",
"timeout": 0,
"exit": true
}
892 changes: 881 additions & 11 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
"lint": "vue-cli-service lint",
"prepare": "husky install",
"test": "playwright test --config=playwright.config.ts --workers=1",
"test:controller": "TS_NODE_PROJECT='./tsconfig.test.json' mocha ./tests/controller/**.ts",
"test:controller": "npx mocha ./tests/controller/**.ts",
"install:local": "npm i ../controllers/packages/solana-controllers/*.tgz && npm i ../controllers/packages/base-controllers/*.tgz",
"locale": "node ./src/scripts/importLocales.js"
},
"dependencies": {
"@babel/runtime": "^7.17.2",
"@gtm-support/vue-gtm": "^1.3.0",
"@headlessui/vue": "^1.5.0",
"@heroicons/vue": "^1.0.5",
Expand Down Expand Up @@ -51,7 +50,6 @@
"copy-to-clipboard": "^3.3.1",
"core-js": "^3.21.1",
"dateformat": "^5.0.3",
"delay-async": "^1.2.0",
"eslint-plugin-node": "^11.1.0",
"eth-rpc-errors": "^4.0.3",
"jwt-decode": "^3.1.2",
Expand All @@ -68,6 +66,8 @@
"vuex-module-decorators": "^1.2.0"
},
"devDependencies": {
"@babel/register": "^7.17.0",
"@babel/runtime": "^7.17.2",
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
"@commitlint/is-ignored": "^16.2.1",
Expand All @@ -80,9 +80,11 @@
"@types/bs58": "^4.0.1",
"@types/dateformat": "^5.0.0",
"@types/elliptic": "^6.4.14",
"@types/jest": "^27.4.1",
"@types/lodash-es": "^4.17.6",
"@types/lodash.merge": "^4.6.6",
"@types/mocha": "^9.0.0",
"@types/mocha": "^9.1.0",
"@types/node": "^17.0.21",
"@types/pump": "^1.1.1",
"@types/readable-stream": "^2.3.13",
"@types/sinon": "^10.0.6",
Expand Down Expand Up @@ -128,6 +130,7 @@
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"tailwindcss": "^3.0.23",
"ts-node": "^10.5.0",
"typescript": "^4.5.5",
"workbox-webpack-plugin": "^6.4.2"
},
Expand Down
1 change: 0 additions & 1 deletion tests/controller/controller.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// import { Connection } from "@solana/web3.js";
import { PopupWithBcHandler } from "@toruslabs/base-controllers";
import { AccountTrackerController, NetworkController, SUPPORTED_NETWORKS, TokenInfoController } from "@toruslabs/solana-controllers";
// import nacl from "@toruslabs/tweetnacl-js";
import assert from "assert";
import base58 from "bs58";
import { cloneDeep } from "lodash-es";
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions tests/mochasetup.js → tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ require("jsdom-global")("", {
url: "https://solana.tor.us",
});

const tsConfigPath = path.resolve(".", "tsconfig.test.json");
// eslint-disable-next-line import/no-extraneous-dependencies
const tsConfigPath = path.resolve(".", "tsconfig.json");

require("ts-node").register({
project: tsConfigPath,
require: ["tsconfig-paths/register"],
transpileOnly: true,
compilerOptions: { module: "CommonJS" },
compilerOptions: { module: "commonjs" },
});

// const register = require("@babel/register").default;
const register = require("@babel/register").default;

// register({
// extensions: [".ts", ".js"],
// rootMode: "upward",
// });
register({
extensions: [".ts", ".js"],
rootMode: "upward",
});

global.fetch = fetch;
global.Headers = fetch.Headers;
2 changes: 1 addition & 1 deletion tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ export async function importAccount(page: Page, privKey: string) {

// TODO: Remove Dummy fn
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function getControllerState(page: Page): Promise<any> {
export async function getControllerState(page: Page): Promise<unknown> {
return {};
}
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"resolveJsonModule": true,
"sourceMap": true,
"baseUrl": ".",
"types": ["webpack-env"],
"types": ["webpack-env", "node", "jest"],
"paths": {
"@/*": ["src/*"]
"@/*": ["src/*"],
"lodash-es" : [ "node_modules/lodash"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/*.tsx", "playwright.config.ts", "src/scripts/*.js"],
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "playwright.config.ts", "src/scripts/*.js"],
"exclude": ["node_modules", "dist"]
}
29 changes: 0 additions & 29 deletions tsconfig.test.json

This file was deleted.

0 comments on commit bea3c3a

Please sign in to comment.