From 55d0f500392f8577b343fb34f2f3ee93c73364d8 Mon Sep 17 00:00:00 2001 From: anschang Date: Thu, 29 Oct 2015 09:25:28 -0700 Subject: [PATCH 1/3] moved .gitignore and node_module into ansoo_chang folder --- ansoo_chang/.gitignore | 4 ++++ README.md => ansoo_chang/README.md | 0 2 files changed, 4 insertions(+) create mode 100644 ansoo_chang/.gitignore rename README.md => ansoo_chang/README.md (100%) 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 From cfaf44b231ec3fd51bef02e42541c4624c451d89 Mon Sep 17 00:00:00 2001 From: anschang Date: Thu, 29 Oct 2015 10:48:56 -0700 Subject: [PATCH 2/3] added gulpfile.js package.json --- ansoo_chang/gulpfile.js | 38 ++++++++++++++++++++++++++++++++++++++ ansoo_chang/package.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 ansoo_chang/gulpfile.js create mode 100644 ansoo_chang/package.json 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" +} From 566a98c04b6474181ef1ff2ce11560ad72d5c538 Mon Sep 17 00:00:00 2001 From: anschang Date: Tue, 24 Nov 2015 21:28:51 -0800 Subject: [PATCH 3/3] fixed indent --- ansoo_chang/test/greet_test.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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'); + }); });