mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-05 23:33:08 +00:00
fix: CI browser/karma (#2204)
* fix: browser tests * chore: remove redundant replacement
This commit is contained in:
parent
88e33a90fd
commit
ef78e52c45
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -56,6 +56,10 @@ jobs:
|
|||||||
|
|
||||||
browser:
|
browser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: mcr.microsoft.com/playwright:v1.48.0-jammy
|
||||||
|
env:
|
||||||
|
HOME: "/root"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@ -64,7 +68,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_JS }}
|
node-version: ${{ env.NODE_JS }}
|
||||||
- uses: ./.github/actions/npm
|
- uses: ./.github/actions/npm
|
||||||
- run: npx playwright install --with-deps
|
|
||||||
- run: npm run build:esm
|
- run: npm run build:esm
|
||||||
- run: npm run test:browser
|
- run: npm run test:browser
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
|
const playwright = require("playwright");
|
||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const playwright = require('playwright');
|
|
||||||
|
|
||||||
process.env.CHROME_BIN = playwright.chromium.executablePath();
|
process.env.CHROME_BIN = playwright.chromium.executablePath();
|
||||||
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
|
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
|
||||||
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
const configuration = {
|
||||||
frameworks: ["webpack", "mocha"],
|
frameworks: ["webpack", "mocha"],
|
||||||
files: ["src/**/!(node).spec.ts"],
|
files: ["src/**/!(node).spec.ts"],
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
@ -13,7 +13,21 @@ module.exports = function (config) {
|
|||||||
},
|
},
|
||||||
envPreprocessor: ["CI"],
|
envPreprocessor: ["CI"],
|
||||||
reporters: ["progress"],
|
reporters: ["progress"],
|
||||||
browsers: ["ChromeHeadless", "FirefoxHeadless"],
|
browsers: process.env.CI
|
||||||
|
? ["ChromeHeadlessCI", "FirefoxHeadless"]
|
||||||
|
: ["ChromeHeadless", "FirefoxHeadless"],
|
||||||
|
customLaunchers: {
|
||||||
|
ChromeHeadlessCI: {
|
||||||
|
base: "ChromeHeadless",
|
||||||
|
flags: [
|
||||||
|
"--no-sandbox",
|
||||||
|
"--disable-gpu",
|
||||||
|
"--disable-dev-shm-usage",
|
||||||
|
"--disable-software-rasterizer",
|
||||||
|
"--disable-extensions"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
singleRun: true,
|
singleRun: true,
|
||||||
client: {
|
client: {
|
||||||
mocha: {
|
mocha: {
|
||||||
@ -28,7 +42,7 @@ module.exports = function (config) {
|
|||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
"process.env.CI": process.env.CI || false,
|
"process.env.CI": process.env.CI || false,
|
||||||
"process.env.DISPLAY": "Browser",
|
"process.env.DISPLAY": "Browser"
|
||||||
}),
|
}),
|
||||||
new webpack.ProvidePlugin({
|
new webpack.ProvidePlugin({
|
||||||
process: "process/browser.js"
|
process: "process/browser.js"
|
||||||
@ -45,5 +59,7 @@ module.exports = function (config) {
|
|||||||
stats: { warnings: false },
|
stats: { warnings: false },
|
||||||
devtool: "inline-source-map"
|
devtool: "inline-source-map"
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
config.set(configuration);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user