Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Okapi 1.6.0 RC2 #417

Merged
merged 5 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,4 @@ python/lib64
.venv
wasm/packages/okapi/src/native_browser/
wasm/packages/okapi/src/native_node/
wasm/packages/okapi/.config/coverage/
6 changes: 0 additions & 6 deletions wasm/lerna.json

This file was deleted.

18 changes: 18 additions & 0 deletions wasm/packages/okapi/.config/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// sync object
module.exports = {
verbose: true,
collectCoverage: true,
collectCoverageFrom: ['**/src/**/*.ts', '!**/node_modules/**'],
testMatch: [
'**/test/*.spec.ts'
],
globals: {
'ts-jest': {
useESM: true,
},
},
transform: {},
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['../test']
}
109 changes: 109 additions & 0 deletions wasm/packages/okapi/.config/karma.conf.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// const webpackConfig = require("./webpack.config.js");
const {resolve} = require("path");
const {SourceMapDevToolPlugin, ProvidePlugin} = require("webpack");
const path = require("path");
module.exports = async (config) => {
config.set({
plugins: [
"karma-webpack",
"karma-jasmine",
"karma-chrome-launcher",
"karma-jasmine-html-reporter",
],

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "..",

singleRun: true, // run and exit for CI pipelines, lol

client: {
clearContext: false, // will show the results in browser once all the testcases are loaded
},

reporters: ["kjhtml", "progress"],

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["jasmine", "webpack"],

// list of files / patterns to load in the browser
// Here I'm including all the Jest tests which are all under the __tests__ directory.
// You may need to tweak this pattern to find your test files/
files: [
{ pattern: "test/**/*.spec.ts", watched: false, included: true, served: true },
{ pattern: "**/*.wasm", watched: false, included: false, served: true },
],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
// Use webpack to bundle our tests files
"test/**/*.spec.ts": ["webpack"],
},
// "Chrome", "ChromeHeadless"
browsers: ["ChromeHeadless"],

webpackMiddleware: {
stats: "errors-only",
bail: true,
},

port: 9876,

colors: true,

// autoWatch: false,
logLevel: config.LOG_INFO,

webpack: {
mode: "development",
devtool: "inline-source-map",
entry: {
wallet: "../test/web.spec.ts",
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: "ts-loader",
options: {
configFile: 'tsconfig.json',
}
}
],
},
resolve: {
alias: {
[path.resolve(__dirname, "../src/native_node/okapi_wasm.js")]:
path.resolve(__dirname, "../src/native_browser/okapi_wasm.js"),
[path.resolve(__dirname, "../src/native_node/okapi_wasm_bg.wasm")]: path.resolve(__dirname, "../src/native_browser/okapi_wasm_bg.wasm"),
},
extensions: [".ts", ".js"],
fallback: {
buffer: require.resolve("buffer")
},
},
output: {
path: resolve(__dirname, "../test/build"),
libraryExport: 'default'
},
plugins: [
new SourceMapDevToolPlugin({
filename: null,
test: /\.(ts|js)($|\?)/i,
}),
new ProvidePlugin({
process: "process/browser",
Buffer: ["buffer", "Buffer"],
}),
],
experiments: {
asyncWebAssembly: true,
},
stats: {
errorDetails: true,
},
},
});
};
59 changes: 0 additions & 59 deletions wasm/packages/okapi/karma.conf.ts

This file was deleted.

Loading