upgraded to gulp@4

This commit is contained in:
Geoff Doty 2018-11-09 10:40:40 -05:00
parent 823c722c13
commit b7f103aa1f
5 changed files with 3233 additions and 1850 deletions

2
dist/testit.js vendored
View File

@ -1,4 +1,4 @@
/*! Test.it v 0.6.2 | MIT | https://github.com/n2geoff/testit */ /*! Test.it v 0.7.0 | MIT | https://github.com/n2geoff/testit */
(function (root, factory) { (function (root, factory) {
"use strict"; "use strict";
if (typeof module === "object" && module.exports) { if (typeof module === "object" && module.exports) {

2
dist/testit.min.js vendored
View File

@ -1,2 +1,2 @@
/*! Test.it v 0.6.2 | MIT | https://github.com/n2geoff/testit */ /*! Test.it v 0.7.0 | MIT | https://github.com/n2geoff/testit */
!function(t,e){"use strict";"object"==typeof module&&module.exports?module.exports=e(t.test):t.test=e(t.test)}(this,function(){"use strict";const t={_tests:{},run:function(t){let e=this._tests,r=[],o=[];return Object.keys(e).forEach(function(t){let n=e[t];try{n(),o.push(`\n+ ${t}`)}catch(e){r.push(`\n- ${t}`),console.error(e)}}),"function"==typeof t?t({pass:o,fail:r}):(console.log(...o,...r),console.log(`\n# tests ${r.length+o.length} pass ${o.length} fail ${r.length}`),!r.length)},it:function(t){return this._tests=t,this},expects:e=>({to:{be:{a:r=>t.expects(e).to.be.an(r),an:t=>{if(-1!==["array"].indexOf(t)){if("array"!==e.constructor.name.toLowerCase())throw new Error(`expected ${typeof e} to be an ${t}`);return!0}if(typeof e!==t)throw new Error(`expected ${typeof e} to be an ${t}`)},like:t=>{if(e!=t)throw new Error(`expected ${e} == ${t}`)}},equal:t=>{if(e!==t)throw new Error(`expected ${e} === ${t}`)},exist:()=>{if(!e)throw new Error(`expected ${e} to be truthy`)},pass:()=>!0,fail:t=>{throw new Error(t)}}})};return t}); !function(t,e){"use strict";"object"==typeof module&&module.exports?module.exports=e(t.test):t.test=e(t.test)}(this,function(){"use strict";const t={_tests:{},run:function(t){let e=this._tests,r=[],o=[];return Object.keys(e).forEach(function(t){let n=e[t];try{n(),o.push(`\n+ ${t}`)}catch(e){r.push(`\n- ${t}`),console.error(e)}}),"function"==typeof t?t({pass:o,fail:r}):(console.log(...o,...r),console.log(`\n# tests ${r.length+o.length} pass ${o.length} fail ${r.length}`),!r.length)},it:function(t){return this._tests=t,this},expects:e=>({to:{be:{a:r=>t.expects(e).to.be.an(r),an:t=>{if(-1!==["array"].indexOf(t)){if("array"!==e.constructor.name.toLowerCase())throw new Error(`expected ${typeof e} to be an ${t}`);return!0}if(typeof e!==t)throw new Error(`expected ${typeof e} to be an ${t}`)},like:t=>{if(e!=t)throw new Error(`expected ${e} == ${t}`)}},equal:t=>{if(e!==t)throw new Error(`expected ${e} === ${t}`)},exist:()=>{if(!e)throw new Error(`expected ${e} to be truthy`)},pass:()=>!0,fail:t=>{throw new Error(t)}}})};return t});

View File

@ -1,9 +1,9 @@
const gulp = require("gulp"); const gulp = require("gulp");
const minify = require('gulp-minify'); const minify = require("gulp-minify");
const strip = require("gulp-strip-comments"); const strip = require("gulp-strip-comments");
gulp.task("default", function() { gulp.task("default", function build() {
gulp.src("./src/testit.js") return gulp.src("./src/testit.js")
.pipe(strip({safe: true})) .pipe(strip({safe: true}))
.pipe(minify({ext: {min: ".min.js"}})) .pipe(minify({ext: {min: ".min.js"}}))
.pipe(gulp.dest("dist")) .pipe(gulp.dest("dist"))

5049
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,16 @@
{ {
"name": "testit", "name": "testit",
"version": "0.6.2", "version": "0.7.0",
"description": "a minimalistic testing library", "description": "a minimalistic testing library",
"main": "src/testit.js", "main": "src/testit.js",
"directories": { "directories": {
"test": "test" "test": "test"
}, },
"devDependencies": { "devDependencies": {
"gulp": "^3.9.1", "gulp": "^4.0.0",
"gulp-minify": "^2.1.0", "gulp-minify": "^3.1.0",
"gulp-strip-comments": "^2.5.2", "gulp-strip-comments": "^2.5.2",
"jshint": "^2.9.5" "jshint": "^2.9.6"
}, },
"scripts": { "scripts": {
"build": "node_modules/.bin/gulp", "build": "node_modules/.bin/gulp",