-
Notifications
You must be signed in to change notification settings - Fork 20
Gulp and package.json #51
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
Open
timcmiller
wants to merge
10
commits into
codefellows-sea-d45-javascript:master
Choose a base branch
from
timcmiller:gulp_package
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a0eb9a5
finished assignment
timcmiller c486067
added a folder with my name
timcmiller 32ffa58
commited deleted files
timcmiller 96eeeb2
minor fixes
timcmiller 7b6b1e7
added package.json
timcmiller 441ef23
added dev dependencies
timcmiller 41f1b4f
add jshint
timcmiller e76ca85
Added gulp mocha test
timcmiller 808f35b
added git ignore
timcmiller 0a0f488
Added bonus points
timcmiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| 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('watch', function() { | ||
| gulp.watch(['lib/**', 'test/**', 'gulpfile.js'], ['default']); | ||
| }); | ||
|
|
||
| gulp.task('jshint:test', function() { | ||
| return gulp.src(testFiles) | ||
| .pipe(jshint.reporter('default')); | ||
| }); | ||
|
|
||
| gulp.task('jshint:greet', function() { | ||
| return gulp.src(testFiles) | ||
| .pipe(jshint.reporter('default')); | ||
| }); | ||
|
|
||
| // To implement mocha test | ||
| gulp.task('mocha:test', function() { | ||
| return gulp.src('./test/*.js', {read: false}) | ||
|
|
||
| .pipe(mocha({reporter: 'nyan'})); | ||
| }); | ||
|
|
||
| gulp.task('mocha', ['mocha:test']); | ||
| gulp.task('jshint', ['jshint:test', 'jshint:greet']); | ||
| gulp.task('default', ['jshint', 'mocha']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| exports.greeting = function(name) { | ||
| console.log(arguments); | ||
| name = name || process.argv[2]; | ||
| return 'word ' + name + '!'; | ||
| }; | ||
|
|
||
| console.log(exports.greeting("tim")); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "node": true, | ||
| "predef": ["describe", "it", "before", "after"] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "name": "greet", | ||
| "version": "0.1.0", | ||
| "description": "A super awesome app used greet people!", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "./node_modules/gulp/bin/gulp.js" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/timcmiller/simple-test-and-modular-patterns.git" | ||
| }, | ||
| "keywords": [ | ||
| "greet" | ||
| ], | ||
| "author": "Tim Miller", | ||
| "license": "MIT", | ||
| "bugs": { | ||
| "url": "https://github.com/timcmiller/simple-test-and-modular-patterns/issues" | ||
| }, | ||
| "homepage": "https://github.com/timcmiller/simple-test-and-modular-patterns#readme", | ||
| "devDependencies": { | ||
| "chai": "3.4.0", | ||
| "gulp": "^3.9.0", | ||
| "gulp-jshint": "^1.11.2", | ||
| "gulp-mocha": "^2.1.3", | ||
| "mocha": "2.3.3" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/usr/bin/env node | ||
| 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.greeting('tim')).to.eql('word tim!'); | ||
| }); | ||
|
|
||
| describe('calling this funciton through node', function() { | ||
|
|
||
| before(function() { | ||
| this.backup = process.argv; | ||
| process.argv = ['node', 'myfile', 'test name']; | ||
|
|
||
| }); | ||
|
|
||
| after(function() { | ||
| process.argv = this.backup; | ||
| }); | ||
|
|
||
| it('should pull from process.argv', function() { | ||
| expect(greet.greeting()).eql('word test name!'); | ||
| }); | ||
| }); | ||
|
|
||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really small file compared to what I'm used to. Check out a ton of the options you can set for jshint: https://github.com/jshint/jshint/blob/master/examples/.jshintrc.