All Projects → pixijs → floss

pixijs / floss

Licence: MIT license
Unit-testing for those hard to reach places

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to floss

react-testing-mocha-chai-enzyme
A solid test setup for React components with Mocha, Chai, Sinon, Enzyme in a Webpack/Babel application.
Stars: ✭ 48 (+84.62%)
Mutual labels:  coverage, mocha, travis-ci, sinon
Eth Gas Reporter
Gas usage per unit test. Average gas usage per method. A mocha reporter.
Stars: ✭ 330 (+1169.23%)
Mutual labels:  unit-testing, mocha
Sazerac
Data-driven unit testing for Jasmine, Mocha, and Jest
Stars: ✭ 322 (+1138.46%)
Mutual labels:  unit-testing, mocha
Sinon
Test spies, stubs and mocks for JavaScript.
Stars: ✭ 8,828 (+33853.85%)
Mutual labels:  unit-testing, sinon
unity-ci-test
Example Unity Project using TravisCI
Stars: ✭ 35 (+34.62%)
Mutual labels:  unit-testing, travis-ci
tropic
🍍 Test Runner Library
Stars: ✭ 29 (+11.54%)
Mutual labels:  unit-testing, mocha
Utplsql
Testing Framework for PL/SQL
Stars: ✭ 402 (+1446.15%)
Mutual labels:  unit-testing, coverage
Teaspoon
Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
Stars: ✭ 1,443 (+5450%)
Mutual labels:  coverage, mocha
Snap Shot
Jest-like snapshot feature for the rest of us, works magically by finding the right caller function
Stars: ✭ 170 (+553.85%)
Mutual labels:  unit-testing, mocha
Redux Actions Assertions
Simplify testing of redux action and async action creators
Stars: ✭ 177 (+580.77%)
Mutual labels:  unit-testing, mocha
travis-ci-tutorial-java
Just to learn how to use travis-ci in a java project!
Stars: ✭ 38 (+46.15%)
Mutual labels:  coverage, travis-ci
developer-ci-benefits
Talk docs—includes CI (Continuous Integration) benefits, description, and setup tips 💡💪
Stars: ✭ 29 (+11.54%)
Mutual labels:  unit-testing, travis-ci
currency-api
A demo project on how to test a node/express app with Mocha, Nock and proxyquire (MNP) and code coverage with nyc/istanbul.
Stars: ✭ 19 (-26.92%)
Mutual labels:  unit-testing, mocha
awesome-javascript-testing
🔧 Awesome JavaScript testing resources
Stars: ✭ 28 (+7.69%)
Mutual labels:  unit-testing, mocha
Express Mongoose Es6 Rest Api
💥 A boilerplate application for building RESTful APIs Microservice in Node.js using express and mongoose in ES6 with code coverage and JsonWebToken Authentication
Stars: ✭ 2,811 (+10711.54%)
Mutual labels:  coverage, mocha
Pg Mem
An in memory postgres DB instance for your unit tests
Stars: ✭ 350 (+1246.15%)
Mutual labels:  unit-testing, mocha
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (+26.92%)
Mutual labels:  unit-testing, mocha
React Base
atSistemas React/Redux Isomorphic Platform
Stars: ✭ 82 (+215.38%)
Mutual labels:  coverage, mocha
Karma Webpack Example
Karma + Webpack + Mocha + Chai + Istanbul
Stars: ✭ 88 (+238.46%)
Mutual labels:  coverage, mocha
Go Script Bash
Framework for writing modular, discoverable, testable Bash scripts
Stars: ✭ 77 (+196.15%)
Mutual labels:  unit-testing, coverage

Floss

Unit-testing for those hard to reach places.

Node.js CI npm version

Uses Electron to provide a Mocha unit-testing environment which can be run headlessly or to debugged with DevTools. This was largely inspired by the electron-mocha and mocha-electron projects but didn't quite have the debugging features needed to develop tests.

Installation

Install globally:

npm install -g floss electron

Install locally within a project:

npm install floss electron --save-dev

Debug Mode

Open tests in an Electron window where test can can be debugged with debugger and dev tools.

await floss({
    path: 'test/*.js',
    debug: true
});

Mocha Reporter

The reporter and reporterOptions are pass-through options for Mocha to specify a different reporter when running Floss in non-debug mode.

await floss({
    path: 'test/*.js',
    reporter: 'xunit',
    reporterOptions: {
    	filename: 'report.xml'
    }
});

Custom Options

Additional properties can be passed to the test code by adding more values to the run options.

await floss({
    path: 'test/*.js',
    customUrl: 'http://localhost:8080' // <- custom
});

The test code and use the global options property to have access to the run options.

console.log(options.customUrl); // logs: http://localhost:8080

Electron Arguments

Commandline arguments can be passed to Electron directly by using args. In the example below, you may wan to disable Electron's user-gesture policy if you are testing HTML video or audio playback.

await floss({
    path: 'test/index.js',
    args: ['--autoplay-policy=no-user-gesture-required']
});

Command Line Usage

Arguments

  • --path or -p (String) Path to the file to test
  • --debug or -d (Boolean) Enable to run in headful mode, default false.
  • --quiet or -q (Boolean) Prevent console[log/info/error/warn/dir] messages from appearing in stdout.
  • --electron or -e (String) Path to the electron to use.
  • --reporter or -R (String) Mocha reporter type, default spec.
  • --reporterOptions or -O (String) Mocha reporter options.
  • --require or -r (String) Module to require (e.g., ts-node/register).
  • -- [args] Additional arguments can be passed to Electron after --

Usage

Command Line usage when installed globally:

floss --path "test/*.js"

Or installed locally:

node node_modules/.bin/floss --path "test/*.js"

Alernatively, within the package.json's' scripts:

{
    "scripts": {
        "test": "floss --path \"test/*.js\""
    }
}

Debug Mode

Open tests in an Electron window where test can can be debugged with debugger and dev tools.

floss --path "test/*.js" --debug

Using TypeScript

Support can easily be added for writing tests in TypeScript using ts-node.

floss --path "test/*.ts" --require ts-node/register

Istanbul Code Coverage

Floss supports nyc. To use it, just use floss as you would mocha:

nyc floss --path "test/*.js"

Mocha Reporter

Can use the same reporter options as the API mentioned above. The reporterOptions are expressed as a querystring, for instance varname=foo&another=bar.

floss --path "test/*.js" \
    --reporter=xunit \
    --reporterOptions output=report.xml

Electron Arguments

Supports passing additional arguments to Electron after --.

floss --path "test/*.js" -- --autoplay-policy=no-user-gesture-required

Custom Electron Version

Some application may require a specific version of Electron. Floss uses Electron 10.0.0+, but you can specific the path to your own version. The custom version can be used either through the commandline argument --electron, by setting the Node environmental variable ELECTRON_PATH or by setting the run option electron.

floss --path "test/.js" \
	--electron /usr/local/bin/electron
ELECTRON_PATH=/usr/local/bin/electron floss --path "test/*.js"

GitHub Actions Integration

name: Node.js CI
on:
  push:
    branches: [ '**' ]
    tags: [ '**' ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v1
      with:
        node-version: '12'
    - run: npm install
    - uses: GabrielBB/[email protected]
      with:
        run: npm test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].