Giter VIP home page Giter VIP logo

godaddy-test-tools's Introduction

godaddy-test-tools

gulp tools for testing node libraries with mocha and istanbul as well as linting using godaddy-style.

Usage

npm install --save-dev godaddy-test-tools

... add the package to your gulpfile.js

'use strict';

var gulp = require('gulp');
require('godaddy-test-tools')(gulp, {
  // change any of the options listed below as needed
});

// define other gulp tasks or override already defined tasks as desired

... or gulpfile.babel.js if you are using ES6

import testTools from 'godaddy-test-tools';
import gulp from 'gulp';

testTools(gulp, {
  // change any of the options listed below as needed
});

Running gulp help will show all the tasks and a description (if provided) for each of the tasks.

Options

  • es6: Specifies that your code is written in ES6 (+ JSX). You must also name your gulpfile gulpfile.babel.js. Defaults to false.
  • reporter: The reporter to use for mocha. default: process.env.MOCHA_REPORTER || 'spec'
  • sourceFiles: The source files that will be watched and code coverage. default: lib/**/*.js
  • unitTestFiles: A glob-able path(s) to all the unit test files. default: test/unit/**/*.js
  • integrationTestFiles: A glob-able path(s) to all the integration test files. defaut: test/integration/**/*.js
  • istanbul: Options for gulp-istanbul
  • watchFiles: default: [sourceFiles, unitTestFiles, integrationTestFiles]
  • lint:
    • filenameConvention: example: { type: (kebob, snake, camel), exclude: /regex/, files: ['lib/**/*.js', 'test/**/*.js'] }
    • files: a list of glob-able file paths to include in the lint checks. default:
        [
          sourceFiles,
          unitTestFiles,
          integrationTestFiles,
          'index.js',
          'main.js',
          'gulpfile.js',
          'gulpfile.babel.js',
          'config/**/*.json',
          'config/**/*.js',
          'lib/**/*.json',
          'test/**/*.json'
        ]
    • eslint: the argument passed to gulp-eslint. default: require.resolve('godaddy-style/dist/es5/.eslintrc').
    • jshint: the argument passed to gulp-jshint. default: require.resolve('godaddy-style/dist/.jshintrc').
    • jscs: the argument passed to gulp-jscs. default: require.resolve('godaddy-style/dist/es5/.jscsrc').
      • reporter: optional: [fail, failOnError]
      • files: specify which files should be ran through jscs default:
          [
            options.sourceFiles,
            options.unitTestFiles,
            options.integrationTestFiles,
            'index.js',
            'main.js',
            'gulpfile.js',
            'gulpfile.babel.js',
            'config/**/*.js'
          ]
    • default: change the default linter from eslint
    • linters: change which linters are run when calling gulp lint
    • eslintFailOnError: failure after the first lint error is found. default: fail after all files have been linted

This tool defaults to a specific folder structure, but the options above allow for configuring that as needed:

your-project/
  build/
    coverage/
  lib/
  test/
    unit/
    integration/

Additionally, this project will send system notifications through node-notifier when there are errors in your tests and when tests have run successfully unless you pass the --no-notify option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.