
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
@fpjs-incubator/broyster
Advanced tools
npm install --save-dev @fpjs-incubator/broyster
# or
yarn add --dev @fpjs-incubator/broyster
import * as broysterForBrowser from '@fpjs-incubator/broyster/browser'
import * as broysterForNode from '@fpjs-incubator/broyster/node'
// ...
This package exports the following:
@fpjs-incubator/broyster/node
:
karmaPlugin
That can be used for launching and reporting tests.setHttpsAndServerForKarma
That configures karma for HTTP and HTTPS testing without any additional work.BrowserFlags
Is a collection of currently supported browser arguments that are uniformed for convenience (for
example: Incognito will add launching the browser in incognito mode for Chrome and Edge, but private mode for Firefox).makeKarmaConfigurator
Makes a function that applies an opinionated full configuration, used by Fingerprint's projects, to Karma.@fpjs-incubator/broyster/browser
:
retryFailedTests
That allows overriding the different behavior of Jasmine specs. The new behavior will retry a failed test up until the maximum specified in the first parameter, with a delay between each such attempt, indicated by the second parameter (in miliseconds). Call this function in the root of any executable file, involved in your testing code, for example, in a Jasmine helper file. Once called, it affects all tests Jasmine runs, even in the other files. For Karma, you can add a file that contains the invocation and point it in your files
, that way you will not have it tied to one specific test file.Use node
exports when using Node.js contexts, like configuring Karma.
Use browser
exports when using browser contexts, like Jasmine.
To use mixed HTTP/HTTPS testing, in your Karma config file you need to use:
import { setHttpsAndServerForKarma } from '@fpjs-incubator/broyster'
setHttpsAndServerForKarma(config)
The launcher provides additional properties: useHttps to specify if this launcher is supposed to connect to the HTTPS server (true) or not.
useHttps: true
deviceType is used only on iOS and allows to choose from iPhone
(default) and iPad
.
You don't need to set a specific device name, the launcher chooses a device automatically. Same on Android.
Android11_ChromeLatest: {
platform: 'iOS',
deviceType: 'iPhone',
osVersion: '17',
browserName: 'Safari',
useHttps: true,
},
firefoxCapabilities an array of extra capabilities specifically for Firefox.
firefoxCapabilities: [
['key', 1],
['key2', true],
['key3', 'value'],
],
osVersion selects the given OS version and also it's beta counterpart. For example, setting the OS version to 17
will choose either 17
or 17 Beta
.
There is a dedicated reporter that will mark successful tests as passed in BrowserStack.
config.set({
reporters: [...config.reporters, 'BrowserStack'],
})
The following config options are available inside the browserStack section of the config:
idleTimeout
: expressed in miliseconds, specifies the amount of time that BrowserStack is supposed to keep the session alive without any activity before automatically killing it.The following config options are available inside the browserStack section of the config:
queueTimeout
: expressed in miliseconds, specifies the maximum amount of time to wait for a the BrowserStack queue to free up a slot.flags
: a unified set of extra arguments that will be passed to the browser. For example passing incognito will apply the relevant seting to the browsers for which the flags were specified (incongnito in Chrome, private mode in Firefox or nothing in the case of Safari). Currently supported flags can be found under the BrowserFlags export. Example: import { BrowserFlags } from '@fpjs-incubator/broyster/node'
...
Incognito_Chrome: {
platform: 'Windows',
osVersion: '10',
browserName: 'Chrome',
browserVersion: '57',
useHttps: true,
flags: [BrowserFlags.Incognito],
},
makeKarmaConfigurator
is an alternative to creating a Karma configuration from scratch.
The function creates an opinionated configuration used by Fingerprint's projects, but has few options and easy to use.
The configuration is aimed to run TypeScript tests with Jasmine.
Example:
karma.conf.ts
import { makeKarmaConfigurator } from '@fpjs-incubator/broyster/node'
module.exports = makeKarmaConfigurator({
projectName: 'My project',
includeFiles: ['src/**/*.ts'],
})
karma start --preset local --single-run
karma start --preset browserstack --single-run
Or only beta versions of these browsers:
karma start --preset browserstack-beta --single-run
You can also view its source code to see what capabilities the Karma plugin provides.
FAQs
Test tools
We found that @fpjs-incubator/broyster demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.