Skip to content

snapyjs/snapy-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snapy-node

Plugin of snapy.

Test runner for node.

snapy.config

// ./test/snapy.config.js
module.exports = {

  // …

  // Pipes all output to terminal during testing. Usefull when developing snapy plugins
  directOutput: false, // Boolean

  // build target for webpack
  webpack.target: "node", // String

  // …

}

caveats

the test files will be bundled, thus __filename and __dirname won't work as expected. The same is true for all relatively required files:

// test/test.js
require("../lib/file.js")
// lib/file.js
console.log(__dirname) // will output . instead of lib/

You can disable bundling by prefixing a !. This will also exclude it from the change detection.

// test/test.js
require("!../lib/file.js")

License

Copyright (c) 2017 Paul Pflugradt Licensed under the MIT license.