Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ansoo_chang/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.sw?
node_modules
.DS_Store
test/node_modules
File renamed without changes.
38 changes: 38 additions & 0 deletions ansoo_chang/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha')
var appFiles = ['index.js', 'lib/**/*.js', 'bin/**/*.js'];
var testFiles = ['test/**/*.js'];

gulp.task('jshint:test', function() {
return gulp.src(testFiles)
.pipe(jshint({
options: {
node: true,
globals: {
describe: true,
it: true,
before: true,
after: true
}
}
}))
.pipe(jshint.reporter('default'));
});


gulp.task('mocha:test', function() {
return gulp.src(testFiles)
.pipe(mocha({
options: {
node: true,
globals: {
describe: true,
it: true,
before: true,
after: true
}
}
}))
.pipe(jshint.reporter('default'));
});
35 changes: 35 additions & 0 deletions ansoo_chang/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "package-greet-test",
"version": "0.1.0",
"description": "App for testing greet",
"main": "index.js",
"directories": {
"test": "test"
},
"dependencies": {
"chai": "^3.4.0"
},
"devDependencies": {
"chai": "^3.4.0",
"gulp": "^3.9.0",
"gulp-jshint": "^1.11.2",
"gulp-mocha": "^2.1.3",
"mocha": "^2.3.3"
},
"scripts": {
"test": "./node_modules/mocha/bin/mocha"
},
"repository": {
"type": "git",
"url": "git+https://github.com/anschang/simple-test-and-modular-patterns.git"
},
"keywords": [
"test"
],
"author": "Ansoo",
"license": "MIT",
"bugs": {
"url": "https://github.com/anschang/simple-test-and-modular-patterns/issues"
},
"homepage": "https://github.com/anschang/simple-test-and-modular-patterns#readme"
}
10 changes: 3 additions & 7 deletions ansoo_chang/test/greet_test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
'use strict';

// note : below shows long verison...
// var chai = require('chai');
// var expect = chai.expect;

var expect = require('chai').expect;
var greet = require(__dirname + '/../lib/greet');

describe('the greet function', function() {
it('should greet someone by name', function() {
expect(greet('Ansoo')).to.eql('Hello Ansoo');
});
it('should greet someone by name', function() {
expect(greet('Ansoo')).to.eql('Hello Ansoo');
});
});