From c0a6b725259bc8e03d1558369e0be83fc145fa17 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sun, 1 Oct 2017 16:18:03 -0700 Subject: [PATCH] Scaffold: Normalize repository --- .gitignore | 4 ++++ .travis.yml | 5 ++++- LICENSE | 2 +- README.md | 14 ++++++++++---- appveyor.yml | 25 +++++++++++++++++++++++++ package.json | 20 +++++++++++++------- test/index.js | 31 +++++++++++++++---------------- 7 files changed, 72 insertions(+), 29 deletions(-) create mode 100644 appveyor.yml diff --git a/.gitignore b/.gitignore index 6f63646..da8ada8 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,7 @@ node_modules # Garbage files .DS_Store + +# Generated by integration tests +test/fixtures/tmp +test/fixtures/out diff --git a/.travis.yml b/.travis.yml index d0def79..0d50ecf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ sudo: false language: node_js node_js: - - 'stable' + - '6' + - '5' - '4' - '0.12' - '0.10' +after_script: + - npm run coveralls diff --git a/LICENSE b/LICENSE index 8ac3554..5f5db3d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Blaine Bublitz, Eric Schoffstall and other contributors +Copyright (c) 2015, 2017 Blaine Bublitz , Eric Schoffstall and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c8f38be..2d201a3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # undertaker-forward-reference -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Gitter chat][gitter-image]][gitter-url] +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] Undertaker custom registry supporting forward referenced tasks. @@ -38,7 +38,7 @@ gulp.task('forward-ref', function(cb){ ## API -### ForwardReferenceRegistry +### `ForwardReferenceRegistry()` Constructor for the registry. Pass an instance of this registry to `gulp.registry`. @@ -47,11 +47,17 @@ Constructor for the registry. Pass an instance of this registry to `gulp.registr MIT [downloads-image]: http://img.shields.io/npm/dm/undertaker-forward-reference.svg -[npm-url]: https://npmjs.org/package/undertaker-forward-reference +[npm-url]: https://npmjs.com/package/undertaker-forward-reference [npm-image]: http://img.shields.io/npm/v/undertaker-forward-reference.svg [travis-url]: https://travis-ci.org/gulpjs/undertaker-forward-reference -[travis-image]: http://img.shields.io/travis/gulpjs/undertaker-forward-reference.svg +[travis-image]: http://img.shields.io/travis/gulpjs/undertaker-forward-reference.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/undertaker-forward-reference +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/undertaker-forward-reference.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/undertaker-forward-reference +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/undertaker-forward-reference/master.svg [gitter-url]: https://gitter.im/gulpjs/gulp [gitter-image]: https://badges.gitter.im/gulpjs/gulp.png diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..625fc10 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,25 @@ +# http://www.appveyor.com/docs/appveyor-yml +# http://www.appveyor.com/docs/lang/nodejs-iojs + +environment: + matrix: + # node.js + - nodejs_version: "0.10" + - nodejs_version: "0.12" + - nodejs_version: "4" + - nodejs_version: "5" + - nodejs_version: "6" + +install: + - ps: Install-Product node $env:nodejs_version + - npm install + +test_script: + - node --version + - npm --version + - cmd: npm test + +build: off + +# build version format +version: "{build}" diff --git a/package.json b/package.json index 7428d8a..3c09be7 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { "name": "undertaker-forward-reference", "version": "1.0.1", - "description": "Undertaker custom registry supporting forward referenced tasks", + "description": "Undertaker custom registry supporting forward referenced tasks.", "author": "Gulp Team (http://gulpjs.com/)", - "contributors": [], + "contributors": [ + "Blaine Bublitz " + ], "repository": "gulpjs/undertaker-forward-reference", "license": "MIT", "engines": { @@ -15,20 +17,24 @@ "index.js" ], "scripts": { - "lint": "eslint . && jscs index.js test/", + "lint": "eslint index.js test/ && jscs index.js test/", "pretest": "npm run lint", - "test": "lab -cv" + "test": "mocha --async-only", + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls" }, "dependencies": { "undertaker-registry": "^1.0.0" }, "devDependencies": { - "code": "^1.4.1", - "eslint": "^1.7.3", + "eslint": "^1.10.3", "eslint-config-gulp": "^2.0.0", + "expect": "^1.20.2", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", "jscs": "^2.4.0", "jscs-preset-gulp": "^1.0.0", - "lab": "^6.2.0" + "mocha": "^3.2.0" }, "keywords": [ "forward reference", diff --git a/test/index.js b/test/index.js index 71d182e..316fc8c 100644 --- a/test/index.js +++ b/test/index.js @@ -1,53 +1,52 @@ 'use strict'; -var lab = exports.lab = require('lab').script(); -var code = require('code'); +var expect = require('expect'); var Registry = require('../'); function noop() {} -lab.experiment('Forward Reference Registry', function() { +describe('Forward Reference Registry', function() { var registry; - lab.beforeEach(function(done) { + beforeEach(function(done) { registry = new Registry(); done(); }); - lab.test('returns a function even if not registered', function(done) { + it('returns a function even if not registered', function(done) { var task = registry.get('nothing'); - code.expect(task).to.be.a.function(); + expect(task).toBeA('function'); done(); }); - lab.test('does not need to be constructed with new', function(done) { + it('does not need to be constructed with new', function(done) { registry = Registry(); var task = registry.get('nothing'); - code.expect(task).to.be.a.function(); + expect(task).toBeA('function'); done(); }); - lab.test('forward reference function mimics task name', function(done) { + it('forward reference function mimics task name', function(done) { var task = registry.get('nothing'); - code.expect(task.displayName).to.equal('nothing'); + expect(task.displayName).toEqual('nothing'); done(); }); - lab.test('returns the task if already registered', function(done) { + it('returns the task if already registered', function(done) { registry.set('nothing', noop); var task = registry.get('nothing'); - code.expect(task).to.equal(noop); + expect(task).toEqual(noop); done(); }); - lab.test('excutes task when forward reference is called', function(done) { + it('excutes task when forward reference is called', function(done) { var count = 0; function actualTask() { count++; - code.expect(count).to.equal(1); + expect(count).toEqual(1); done(); } @@ -57,9 +56,9 @@ lab.experiment('Forward Reference Registry', function() { task(); }); - lab.test('throws if task is not defined before forward ref is called', function(done) { + it('throws if task is not defined before forward ref is called', function(done) { var task = registry.get('nothing'); - code.expect(task).to.throw('Forward referenced task \'nothing\' not defined before use'); + expect(task).toThrow('Forward referenced task \'nothing\' not defined before use'); done(); }); });