New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding es6 tests #1

Merged
merged 2 commits into from Nov 1, 2015
Jump to file or symbol
Failed to load files and symbols.
+35 −48
Diff settings

Always

Just for now

View
@@ -1,2 +1,4 @@
documentation
node_modules
built-tests
dist
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -2,14 +2,32 @@ var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
gulp.task('default', function () {
var buildCode = function () {
var jsdoc = require('gulp-jsdoc');
gulp.src("./src/*.js").pipe(jsdoc("./documentation"));
gulp.src("./src/*.js")
return gulp.src("./src/*.js")
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(concat("all.js"))
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("dist"));
};
var buildTests = function () {
return gulp.src("./tests/*.js")
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(gulp.dest("built-tests"));
}
gulp.task('default', function () {
return buildCode();
});
gulp.task('buildTests', ['default'], function () {
return buildTests();
});
gulp.task('test', ['buildTests'], function () {
var mocha = require('gulp-mocha');
gulp.src("./built-tests/GCD-test.js", {read:false})
.pipe(mocha({reporter:'nyan'}));
});
View
@@ -1,7 +1,7 @@
{
"name": "theorem",
"description": "A ES6 transpiled via Babel to ES5 library that adds methods to the Math class for working with JS.",
"version": "1.0.4",
"version": "1.1.0",
"homepage": "https://github.com/aasierra/theorem",
"author": {
"name": "Anthony A Sierra",
@@ -14,6 +14,8 @@
"babel-preset-es2015":"6.0.14",
"babel-plugin-transform-object-rest-spread":"6.0.14",
"gulp-babel":"6.0.0",
"gulp":"3.9.0"
"gulp":"3.9.0",
"mocha":"2.3.3",
"chai":"3.4.0"
}
}
View
@@ -0,0 +1,8 @@
let GCD = require("../src/GCD.js");
let expect = require('chai').expect;
let assert = require('assert');
describe("Math GCD Should work", () => {
it('should return 3 for 12 and 15', () => {
assert.equal(Math.gcd(12,15), 3);
});
});
ProTip! Use n and p to navigate between commits in a pull request.