mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-07 16:23:09 +00:00
tests: all files in tests are actually node only
Except for a live test that always fails.
This commit is contained in:
parent
5ba1ee12c7
commit
6d717f2e55
@ -2,7 +2,6 @@
|
|||||||
"name": "@waku/create",
|
"name": "@waku/create",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "Easily create a Waku node",
|
"description": "Easily create a Waku node",
|
||||||
"main": "./dist/index.js",
|
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@ -11,13 +10,6 @@
|
|||||||
"import": "./dist/index.js"
|
"import": "./dist/index.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"lib/*": [
|
|
||||||
"dist/lib/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "Waku Team",
|
"author": "Waku Team",
|
||||||
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/create#readme",
|
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/create#readme",
|
||||||
|
|||||||
@ -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",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@ -3,7 +3,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "Waku tests",
|
"description": "Waku tests",
|
||||||
"main": "./dist/index.js",
|
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@ -12,13 +11,6 @@
|
|||||||
"import": "./dist/index.js"
|
"import": "./dist/index.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"lib/*": [
|
|
||||||
"dist/lib/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "Waku Team",
|
"author": "Waku Team",
|
||||||
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/tests#readme",
|
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/tests#readme",
|
||||||
@ -57,7 +49,6 @@
|
|||||||
"check:tsc": "tsc -p tsconfig.json",
|
"check:tsc": "tsc -p tsconfig.json",
|
||||||
"test": "run-s test:*",
|
"test": "run-s test:*",
|
||||||
"test:node": "TS_NODE_PROJECT=./tsconfig.json mocha",
|
"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"
|
"reset-hard": "git clean -dfx -e .idea && git reset --hard && npm i && npm run build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { PeerId } from "@libp2p/interface-peer-id";
|
import { PeerId } from "@libp2p/interface-peer-id";
|
||||||
import { DefaultPubSubTopic } from "@waku/core";
|
|
||||||
import {
|
import {
|
||||||
|
DefaultPubSubTopic,
|
||||||
generatePrivateKey,
|
generatePrivateKey,
|
||||||
generateSymmetricKey,
|
generateSymmetricKey,
|
||||||
getPublicKey,
|
getPublicKey,
|
||||||
|
|||||||
@ -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;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Loading…
x
Reference in New Issue
Block a user