Skip to content

Commit

Permalink
fix webpack config and test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerbenw committed Apr 24, 2024
1 parent ab14e7d commit 25b48b7
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 33 deletions.
8 changes: 4 additions & 4 deletions test/electron/fixtures/app/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Bugsnag = require('@bugsnag/electron/main')
const configFile = process.env.BUGSNAG_CONFIG || 'default'
// eslint-disable-next-line no-undef
const bugsnagConfig = __non_webpack_require__(`./${configFile}`)
// const preloadFile = process.env.BUGSNAG_PRELOAD || 'default'

// eslint-disable-next-line no-undef
const config = { ...baseBugsnagConfig, ...bugsnagConfig() }
Expand All @@ -35,11 +34,12 @@ function createWindow () {
}
})

// eslint-disable-next-line no-undef
mainWindow.loadFile(join(__dirname, htmlRelativePath))

// Open the DevTools.
// mainWindow.webContents.openDevTools()

// and load the index.html of the app.
// eslint-disable-next-line no-undef
mainWindow.loadFile(join(__dirname, htmlRelativePath))
}

// This method will be called when Electron has finished
Expand Down
7 changes: 7 additions & 0 deletions test/electron/fixtures/app/webpack.renderer.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
const { readdirSync } = require('fs')
const { parse } = require('path')
const entrypoints = {}
readdirSync('./src/preloads').forEach(name => {
entrypoints[parse(name).name] = `./src/preloads/${name}`
})

module.exports = {
resolve: {
fallback: {
Expand Down
4 changes: 2 additions & 2 deletions test/electron/fixtures/events/renderer/config/appType.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
4 changes: 2 additions & 2 deletions test/electron/fixtures/events/renderer/config/clear-user.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
4 changes: 2 additions & 2 deletions test/electron/fixtures/events/renderer/config/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
4 changes: 2 additions & 2 deletions test/electron/fixtures/events/renderer/config/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
4 changes: 2 additions & 2 deletions test/electron/fixtures/events/renderer/config/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js"
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js"
}
],
"type": "electronrendererjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"lineNumber": 1,
"file": "./renderer.js"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"lineNumber": 1,
"file": "./renderer.js"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"lineNumber": 1,
"file": "./renderer.js"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"lineNumber": 1,
"file": "./renderer.js"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"lineNumber": 1,
"file": "./renderer.js"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js",
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js",
"code": {
"1": "{TYPE:string}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
"errorClass": "Error",
"stacktrace": [
{
"lineNumber": 31,
"file": "./renderer.js",
"lineNumber": 1,
"file": ".webpack/renderer/main_window/index.js",
"code": {
"1": "{TYPE:string}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"errorMessage": "foo is not defined",
"stacktrace": [
{
"file": "./renderer.js",
"file": ".webpack/renderer/main_window/index.js",
"lineNumber": 27,
"code": {
"1": "{TYPE:string}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"errorMessage": "foo is not defined",
"stacktrace": [
{
"file": "./renderer.js",
"file": ".webpack/renderer/main_window/index.js",
"lineNumber": 27,
"code": {
"1": "{TYPE:string}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"errorMessage": "invalid",
"stacktrace": [
{
"file": "./renderer.js",
"file": ".webpack/renderer/main_window/index.js",
"lineNumber": 23,
"code": {
"1": "{TYPE:string}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"errorMessage": "invalid",
"stacktrace": [
{
"file": "./renderer.js",
"file": ".webpack/renderer/main_window/index.js",
"lineNumber": 23,
"code": {
"1": "{TYPE:string}"
Expand Down

0 comments on commit 25b48b7

Please sign in to comment.