tests: all files in `tests` are actually node only

Except for a live test that always fails.
This commit is contained in:
fryorcraken.eth 2022-11-02 14:08:32 +11:00
parent 5ba1ee12c7
commit 6d717f2e55
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
5 changed files with 1 additions and 115 deletions

View File

@ -2,7 +2,6 @@
"name": "@waku/create",
"version": "0.0.1",
"description": "Easily create a Waku node",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"exports": {
@ -11,13 +10,6 @@
"import": "./dist/index.js"
}
},
"typesVersions": {
"*": {
"lib/*": [
"dist/lib/*"
]
}
},
"type": "module",
"author": "Waku Team",
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/create#readme",

View File

@ -1,55 +0,0 @@
process.env.CHROME_BIN = require("puppeteer").executablePath();
const webpack = require("webpack");
module.exports = function (config) {
config.set({
frameworks: ["webpack", "mocha"],
files: ["tests/**/!(node).spec.ts"],
preprocessors: {
"tests/**/!(node).spec.ts": ["webpack"],
},
envPreprocessor: ["CI"],
reporters: ["progress"],
browsers: ["ChromeHeadless"],
singleRun: true,
client: {
mocha: {
timeout: 6000, // Default is 2s
},
},
webpack: {
mode: "production",
module: {
rules: [
{
test: /\.(js|tsx?)$/,
use: [
{
loader: "ts-loader",
options: { configFile: "tsconfig.karma.json" },
},
],
exclude: /(node_modules)|(node\.spec\.ts)/,
},
{
test: /node\.spec\.ts$/,
use: "ignore-loader",
},
],
},
plugins: [
new webpack.DefinePlugin({
"process.env.CI": process.env.CI || false,
}),
new webpack.ProvidePlugin({
process: "process/browser.js",
}),
],
resolve: {
extensions: [".ts", ".js"],
},
stats: { warnings: false },
devtool: "inline-source-map",
},
});
};

View File

@ -3,7 +3,6 @@
"private": true,
"version": "0.0.1",
"description": "Waku tests",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"exports": {
@ -12,13 +11,6 @@
"import": "./dist/index.js"
}
},
"typesVersions": {
"*": {
"lib/*": [
"dist/lib/*"
]
}
},
"type": "module",
"author": "Waku Team",
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/tests#readme",
@ -57,7 +49,6 @@
"check:tsc": "tsc -p tsconfig.json",
"test": "run-s test:*",
"test:node": "TS_NODE_PROJECT=./tsconfig.json mocha",
"test:browser": "karma start karma.conf.cjs",
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
},
"engines": {

View File

@ -1,6 +1,6 @@
import { PeerId } from "@libp2p/interface-peer-id";
import { DefaultPubSubTopic } from "@waku/core";
import {
DefaultPubSubTopic,
generatePrivateKey,
generateSymmetricKey,
getPublicKey,

View File

@ -1,42 +0,0 @@
import type { PeerId } from "@libp2p/interface-peer-id";
import { createLightNode } from "@waku/create";
import type { WakuLight } from "@waku/interfaces";
import { expect } from "chai";
describe("Waku Dial", function () {
describe("Bootstrap [live data]", function () {
let waku: WakuLight;
afterEach(function () {
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
});
before(function () {
if (process.env.CI) {
this.skip();
}
});
it("Enabling default [live data]", async function () {
// This test depends on fleets.status.im being online.
// This dependence must be removed once DNS discovery is implemented
this.timeout(20_000);
waku = await createLightNode({
defaultBootstrap: true,
});
await waku.start();
const connectedPeerID: PeerId = await new Promise((resolve) => {
waku.libp2p.connectionManager.addEventListener(
"peer:connect",
(evt) => {
resolve(evt.detail.remotePeer);
}
);
});
expect(connectedPeerID).to.not.be.undefined;
});
});
});