Skip to content

Commit

Permalink
update test fixture to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerbenw committed Apr 22, 2024
1 parent fb8da60 commit ddd37cb
Show file tree
Hide file tree
Showing 12 changed files with 9,350 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
electron: [ '^12.0.0', '^20.0.0', '^25.0.0', '^26.0.0' ]
node-version: [12, 14]
electron: [ '^28.0.0', '^29.0.0', '^30.0.0' ]
node-version: [18, 20]
os: [ ubuntu-22.04, windows-2019 ]

steps:
Expand Down
92 changes: 91 additions & 1 deletion test/electron/fixtures/app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,92 @@
# Packaged app contents
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock
.DS_Store

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Webpack
.webpack/

# Vite
.vite/

# Electron-Forge
out/
65 changes: 47 additions & 18 deletions test/electron/fixtures/app/forge.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
const { FusesPlugin } = require('@electron-forge/plugin-fuses')
const { FuseV1Options, FuseVersion } = require('@electron/fuses')

module.exports = {
packagerConfig: {},
plugins: [
['@electron-forge/plugin-webpack', {
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
entryPoints: [{
html: './index.html',
js: './renderer.js',
name: 'main_window'
}]
}
}]
],
packagerConfig: {
asar: true
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
name: 'Runner'
}
config: {}
},
{
name: '@electron-forge/maker-dmg'
name: '@electron-forge/maker-zip',
platforms: ['darwin']
},
{
name: '@electron-forge/maker-deb',
config: {}
},
{
name: '@electron-forge/maker-rpm',
config: {}
}
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {}
},
{
name: '@electron-forge/plugin-webpack',
config: {
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
entryPoints: [
{
html: './src/index.html',
js: './src/renderer.js',
name: 'main_window'
}
]
}
}
},
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true
})
]
}
5 changes: 3 additions & 2 deletions test/electron/fixtures/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const {
unhandledRejection,
crash,
notify
} = require('./src/errors')
const Bugsnag = require('@bugsnag/electron/main')
} = require('./src/errors.js')
const configFile = process.env.BUGSNAG_CONFIG || 'default'
// eslint-disable-next-line no-undef
const bugsnagConfig = __non_webpack_require__(`./${configFile}`)
Expand All @@ -14,6 +13,8 @@ const preloadFile = process.env.BUGSNAG_PRELOAD || 'default.js'
// eslint-disable-next-line no-undef
const config = { ...baseBugsnagConfig, ...bugsnagConfig() }

const Bugsnag = require('@bugsnag/electron/main')

Bugsnag.start(config)

const { app, BrowserWindow, ipcMain } = require('electron')
Expand Down
Loading

0 comments on commit ddd37cb

Please sign in to comment.