Commit b089ce7e authored by analog-nico's avatar analog-nico
Browse files

Copied tests from main branch (still failing)

parent 1f5501cd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -80,12 +80,15 @@
  "rhino"         : false,    // Enable globals available when your code is running inside of the Rhino runtime environment.
  "wsh"           : false,    // Enable globals available when your code is running as a script for the Windows Script Host.

  // Additional globals introduced by Mocha
  // Additional globals introduced by Mocha and Chai
    "globals": {
    "describe"    : false,
    "xdescribe"   : false,
    "it"          : false,
    "xit"         : false,
    "before"      : false,
    "after"       : false,
    "expect"      : false,
    "Promise"     : true      // See: https://github.com/jshint/jshint/issues/1747
  },

+12 −5
Original line number Diff line number Diff line
@@ -9,11 +9,16 @@ var mocha = require('gulp-mocha');
var chalk = require('chalk');
var rimraf = require('rimraf');

var chai = require("chai");
chai.use(require("chai-as-promised"));
global.expect = chai.expect;


var paths = {
    libJsFiles: './lib/**/*.js',
    gulpfile: './gulpfile.js',
    specFiles: './test/**/*.js'
    specFiles: './test/spec/**/*.js',
    fixtureFiles: './test/fixtures/**/*.js'
};


@@ -24,7 +29,8 @@ gulp.task('watch', function () {
    return gulp.watch([
        paths.libJsFiles,
        paths.gulpfile,
        paths.specFiles
        paths.specFiles,
        paths.fixtureFiles
    ], [
        'validate'
    ]);
@@ -37,7 +43,7 @@ gulp.task('validate', function (done) {

gulp.task('lint', function () {

    return gulp.src([paths.libJsFiles, paths.gulpfile, paths.specFiles])
    return gulp.src([paths.libJsFiles, paths.gulpfile, paths.specFiles, paths.fixtureFiles])
        .pipe(jshint())
        .pipe(jshint.reporter(jshintStylish))
        .pipe(jshint.reporter('fail'));
@@ -56,8 +62,9 @@ gulp.task('test', ['clean'], function (done) {

            gulp.src(paths.specFiles)
                .pipe(mocha())
                .on('error', function () {
                    console.log(chalk.bold.bgRed(' TESTS FAILED '));
                .on('error', function (err) {
                    console.error(String(err));
                    console.error(chalk.bold.bgRed(' TESTS FAILED '));
                    done();
                })
                .pipe(istanbul.writeReports({
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
    "request": "^2.34"
  },
  "devDependencies": {
    "chai": "^1.9.2",
    "chai-as-promised": "^4.1.1",
    "chalk": "^0.5.1",
    "gulp": "^3.8.8",
    "gulp-istanbul": "^0.3.1",
+9 −0
Original line number Diff line number Diff line
'use strict';

var rp = require('../../../lib/rp.js');
var request = require('request');

var rpHasThen = rp('http://localhost:4000/200').then !== undefined;
var requestHasNoThen = request('http://localhost:4000/200').then === undefined;

console.log('rp: ' + rpHasThen + ', request: ' + requestHasNoThen);
+9 −0
Original line number Diff line number Diff line
'use strict';

var request = require('request');
var rp = require('../../../lib/rp.js');

var requestHasNoThen = request('http://localhost:4000/200').then === undefined;
var rpHasThen = rp('http://localhost:4000/200').then !== undefined;

console.log('request: ' + requestHasNoThen + ', rp: ' + rpHasThen);
Loading