diff --git a/ansoo_chang/.gitignore b/ansoo_chang/.gitignore new file mode 100644 index 0000000..b141f44 --- /dev/null +++ b/ansoo_chang/.gitignore @@ -0,0 +1,4 @@ +**/*.sw? +node_modules +.DS_Store +test/node_modules diff --git a/README.md b/ansoo_chang/README.md similarity index 100% rename from README.md rename to ansoo_chang/README.md diff --git a/ansoo_chang/gulpfile.js b/ansoo_chang/gulpfile.js new file mode 100644 index 0000000..c212169 --- /dev/null +++ b/ansoo_chang/gulpfile.js @@ -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')); +}); diff --git a/ansoo_chang/package.json b/ansoo_chang/package.json new file mode 100644 index 0000000..7d08b0d --- /dev/null +++ b/ansoo_chang/package.json @@ -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" +} diff --git a/ansoo_chang/test/greet_test.js b/ansoo_chang/test/greet_test.js index f186791..707262e 100644 --- a/ansoo_chang/test/greet_test.js +++ b/ansoo_chang/test/greet_test.js @@ -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'); + }); });