JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q42418F
  • License MIT

test framework to light up the world

Package Exports

  • @lite-js/torch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@lite-js/torch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@lite-js/torch

Test framework to light up the world.

installation

$ npm install @lite-js/torch [-g]

usage

main process

$ torch test/main

renderer process

$ torch --renderer test/renderer

interactive mode (you can re-run tests by CMD+R)

$ torch --interative test/renderer

watching source files

$ torch --interactive --watch test/renderer

view code coverage

$ torch --coverage test/main && torch-coverage

+ overalls

$ torch --coverage test/main && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage

specify source files (for watching / code coverage)

interactive mode

$ torch --interactive --watch --source-pattern src/**/*.js test/renderer

code coverage

$ torch --coverage --source-pattern src/**/*.js test/main && torch-coverage

options

$ torch --help

  Usage: torch [options]

  Options:

    -h, --help                              output usage information
    -V, --version                           output the version number
    -C, --no-colors                         force disabling of colors
    -O, --reporter-options <k=v,k2=v2,...>  reporter-specific options
    -R, --reporter <name>                   specify the reporter to use
    -S, --sort                              sort test files
    -b, --bail                              bail after first test failure
    -g, --grep <pattern>                    only run tests matching <pattern>
    -f, --fgrep <string>                    only run tests containing <string>
    -i, --invert                            inverts --grep and --fgrep matches
    -r, --require <name>                    require the given module
    -s, --slow <ms>                         "slow" test threshold in milliseconds [75]
    -t, --timeout <ms>                      set test-case timeout in milliseconds [2000]
    -u, --ui <name>                         specify user-interface (bdd|tdd|exports)
    --check-leaks                           check for global variable leaks
    --compilers <ext>:<module>,...          use the given module(s) to compile files
    --coverage                              report coverage
    --debug                                 enable Electron debugger on port [5858]; for --renderer tests show window and dev-tools
    --debug-brk                             like --debug but pauses the script on the first line
    --globals <names>                       allow the given comma-delimited global [names]
    --inline-diffs                          display actual/expected differences inline within each string
    --interactive                           run tests in renderer process in a visible window that can be reloaded to re-run tests
    --interfaces                            display available interfaces
    --no-timeouts                           disables timeouts
    --opts <path>                           specify opts path
    --preload <name>                        preload the given script in renderer process
    --recursive                             include sub directories
    --renderer                              run tests in renderer process
    --require-main <name>                   load the given script in main process before executing tests
    --source-pattern <sources>              glob pattern of source files
    --watch                                 watching source file changes

trouble shooting

using on Travis

Your .travis.yml will need two extra lines of configuration to run this headless on Travis:

before_script:
  - export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start

thanks to

The original idea and most of the code are stolen from electron-mocha, actually you can say that torch is created by adding features onto electron-mocha.