All Projects → alekseykulikov → browserify-test

alekseykulikov / browserify-test

Licence: MIT license
An easy way to test front-end libraries using browserify and mocha

Programming Languages

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

Projects that are alternatives of or similar to browserify-test

Mochify.js
☕️ TDD with Browserify, Mocha, Headless Chrome and WebDriver
Stars: ✭ 338 (+813.51%)
Mutual labels:  browserify, mocha
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (+1689.19%)
Mutual labels:  browserify, mocha
mocaccino.js
Mocha test runner as a Browserify plugin
Stars: ✭ 22 (-40.54%)
Mutual labels:  browserify, mocha
BotBlock.org
BotBlock - The List of Discord Bot Lists and Services
Stars: ✭ 29 (-21.62%)
Mutual labels:  mocha
alexa-skill-test-framework
Framework for easy offline black-box testing of Alexa skills.
Stars: ✭ 64 (+72.97%)
Mutual labels:  mocha
torchjs
Test framework to light up the world.
Stars: ✭ 40 (+8.11%)
Mutual labels:  mocha
earl
☕ Ergonomic, modern and type-safe assertion library for TypeScript
Stars: ✭ 217 (+486.49%)
Mutual labels:  mocha
cypress-slack-reporter
A home for various Cypress Plugins
Stars: ✭ 126 (+240.54%)
Mutual labels:  mocha
fancy-test
extends mocha with helpful, chainable extensions
Stars: ✭ 47 (+27.03%)
Mutual labels:  mocha
typedarray-to-buffer
Convert a typed array to a Buffer without a copy.
Stars: ✭ 64 (+72.97%)
Mutual labels:  browserify
license-key-gen
Generate license keys for given company details
Stars: ✭ 48 (+29.73%)
Mutual labels:  mocha
javascript-unit-testing-with-mocha
Unit test using Mocha and Chai
Stars: ✭ 104 (+181.08%)
Mutual labels:  mocha
FULL-STACK-TUTORIAL
No description or website provided.
Stars: ✭ 41 (+10.81%)
Mutual labels:  mocha
instant-mocha
☕️ Build tests with Webpack and run with Mocha in one command
Stars: ✭ 39 (+5.41%)
Mutual labels:  mocha
react-redux-immutable-webpack-ssr-starter
React + React-Router 4 + Redux + ImmutableJS + Bootstrap + webpack 3 with with Server side rendering, Hot Reload and redux-devtools STARTER
Stars: ✭ 21 (-43.24%)
Mutual labels:  mocha
titef
🌠 A tiny, lightning-fast, zero-dependecies JavaScript test framework 🌠
Stars: ✭ 19 (-48.65%)
Mutual labels:  mocha
generator-speedseed
Oriented to components, allow create/choice template, multiple configuration with easy maintenance
Stars: ✭ 13 (-64.86%)
Mutual labels:  mocha
cypress-browserify-preprocessor
Cypress preprocessor for bundling JavaScript via browserify
Stars: ✭ 23 (-37.84%)
Mutual labels:  browserify
titaniumifier
Get a Titanium™ SDK CommonJS module out of a Node package!
Stars: ✭ 95 (+156.76%)
Mutual labels:  browserify
grunt-mocha-cli
Run Mocha server-side tests in Grunt.
Stars: ✭ 42 (+13.51%)
Mutual labels:  mocha

browserify-test

Simplify testing of front-end libraries using browserify and mocha

Features:

  • No config files, just run your tests in terminal with phantomjs or start watch server to test and debug in actual browser;
  • It builds on top of testem for solid integration with different browsers and platforms;
  • It uses watchify and errorify for better development experience;

Usage

Install with npm and make sure phantomjs is installed (phantomjs -v):

npm install --global browserify-test

Pass test files to browserify-test and enjoy browserified mocha tests:

browserify-test --help

  Usage: browserify-test [options] [./test/*.js ...]

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    -w, --watch                 run watch server on http://localhost:7357
    -t, --transform <t1,t2,..>  add browserify transforms
    -p, --plugins <p1,p2,..>    add browserify plugins
    -b, --browserifyOptions <jsonStringifiedObj>     add browserifyOptions
    --testem, --testemOptions <jsonStringifiedObj>   add testemOptions

browserify-test # run tests for ./test/*.js
browserify-test --watch # start watch server on localhost:7537
browserify-test ./path/to/test.js ./path/to/another-test.js # pass test files as arguments
browserify-test ./lib/**/test.js # use globs
browserify-test --transform [ babelify --presets env ] ./path/to/es6-test.js # use transforms

Integration with npm

Add browserify-test to your development dependencies:

npm install --save-dev browserify-test

And use npm scripts to run your tests in terminal with npm test or start development watch server with npm start.

{
  "scripts": {
    "test": "browserify-test ./test/index.js",
    "start": "browserify-test --watch ./test/index.js"
  },
  "devDependencies": {
    "browserify-test": "^3.1.0"
  }
}

npm hint: you don't need to type ./node_modules/.bin/browserify-test to refer on local copy of browserify-test, npm does it automatically.

Node.js

import run from 'browserify-test'

run({
  watch: false,
  transform: ['brsf', ['babelify', { presets: 'env' }]],
  files: ['./test/file1.js', './test/file2.js'],
}) // Returns the underlying `browserify` instance

Options

  • files (or entries) - Array - a list of files for browserify
  • watch - Boolean - enable watch server
  • transform (or transforms) - Array - a list of browserify transform modules
  • plugins - Array - a list of browserify transform modules
  • browserifyOptions - Object - options to pass as browserify options
  • testemOptions - Object - options to pass as testem options. Note that besides config-level options, the CLI-level options are also available, as are Testem's hooks which can be used to report on testem phases); these can be expressed as strings (to execute shell commands) or as callbacks. Callbacks will be passed the Testem config object, any data object for the hook (only currently used for the undocumented on_change hook, providing a file path property), and a callback which should be invoked with a falsy argument (or no arguments) to indicate a passed Testem test or invoked with a truthy argument (such as an error object) to report a failed Testem test.
  • finalizer - Function called toward end of tests; as in testem, this finalizer will be passed an exit code (set to 0 if normal and 1 if erring) and any (Bluebird) error object. If you wish to execute code prior to the end of all tests, see the docs above on hooks in testemOptions.

License

MIT

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].