This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
222 additions
and
148 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,41 +1,40 @@ | ||
// http://www.jshint.com/docs/ | ||
{ | ||
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment. | ||
"browser": true, // Standard browser globals e.g. `window`, `document`. | ||
"es5": true, // Allow EcmaScript 5 syntax. | ||
"esnext": true, // Allow ES.next specific features such as `const` and `let`. | ||
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.). | ||
"camelcase": false, // Permit only camelcase for `var` and `object indexes`. | ||
"curly": false, // Require {} for every new block or scope. | ||
"eqeqeq": true, // Require triple equals i.e. `===`. | ||
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` | ||
"latedef": true, // Prohibit variable use before definition. | ||
"newcap": true, // Require capitalization of all constructor functions e.g. `new F()`. | ||
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. | ||
"quotmark": "single", // Define quotes to string values. | ||
"regexp": true, // Prohibit `.` and `[^...]` in regular expressions. | ||
"undef": true, // Require all non-global variables be declared before they are used. | ||
"unused": true, // Warn unused variables. | ||
"strict": false, // Require `use strict` pragma in every file. | ||
"trailing": true, // Prohibit trailing whitespaces. | ||
"smarttabs": false, // Suppresses warnings about mixed tabs and spaces | ||
"globals": { // Globals variables. | ||
"angular": false | ||
}, | ||
"predef": [ // Extra globals. | ||
"define", | ||
"require", | ||
"exports", | ||
"module", | ||
"describe", | ||
"before", | ||
"beforeEach", | ||
"after", | ||
"afterEach", | ||
"it" | ||
], | ||
"indent": 2, // Specify indentation spacing | ||
"maxlen": 120, // Max line lenght | ||
"devel": false, // Allow development statements e.g. `console.log();`. | ||
"noempty": true // Prohibit use of empty blocks. | ||
} | ||
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment. | ||
"browser": true, // Standard browser globals e.g. `window`, `document`. | ||
"es5": true, // Allow EcmaScript 5 syntax. | ||
"esnext": true, // Allow ES.next specific features such as `const` and `let`. | ||
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.). | ||
"camelcase": false, // Permit only camelcase for `var` and `object indexes`. | ||
"curly": false, // Require {} for every new block or scope. | ||
"eqeqeq": true, // Require triple equals i.e. `===`. | ||
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` | ||
"latedef": true, // Prohibit variable use before definition. | ||
"newcap": true, // Require capitalization of all constructor functions e.g. `new F()`. | ||
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. | ||
"quotmark": "single", // Define quotes to string values. | ||
"regexp": true, // Prohibit `.` and `[^...]` in regular expressions. | ||
"undef": true, // Require all non-global variables be declared before they are used. | ||
"unused": true, // Warn unused variables. | ||
"strict": false, // Require `use strict` pragma in every file. | ||
"trailing": true, // Prohibit trailing whitespaces. | ||
"smarttabs": false, // Suppresses warnings about mixed tabs and spaces | ||
"globals": { // Globals variables. | ||
"angular": true | ||
}, | ||
"predef": [ // Extra globals. | ||
"define", | ||
"require", | ||
"exports", | ||
"module", | ||
"describe", | ||
"before", | ||
"beforeEach", | ||
"after", | ||
"afterEach", | ||
"it" | ||
], | ||
"indent": 4, // Specify indentation spacing | ||
"maxlen": 120, // Max line lenght | ||
"devel": false, // Allow development statements e.g. `console.log();`. | ||
"noempty": true // Prohibit use of empty blocks. | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,48 +1,48 @@ | ||
{ | ||
"name": "mean", | ||
"description": "Mongo", | ||
"version": "1.0.0", | ||
"private": false, | ||
"author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support).", | ||
"engines": { | ||
"node": "0.10.x", | ||
"npm": "1.2.x" | ||
}, | ||
"scripts": { | ||
"start": "make start", | ||
"test": "make test", | ||
"postinstall": "node_modules/bower/bin/bower install" | ||
}, | ||
"dependencies": { | ||
"express": "latest", | ||
"jade": "latest", | ||
"mongoose": "latest", | ||
"connect-mongo": "latest", | ||
"connect-flash": "latest", | ||
"passport": "latest", | ||
"passport-local": "latest", | ||
"passport-facebook": "latest", | ||
"passport-twitter": "latest", | ||
"passport-github": "latest", | ||
"passport-google-oauth": "latest", | ||
"underscore": "latest", | ||
"async": "latest", | ||
"view-helpers": "latest", | ||
"mean-logger": "latest", | ||
"bower": "latest", | ||
"forever": "latest", | ||
"foreman": "0.0.25" | ||
}, | ||
"devDependencies": { | ||
"supertest": "latest", | ||
"should": "latest", | ||
"mocha": "latest", | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-compass": "~0.3.0", | ||
"grunt-contrib-watch": "~0.4.4", | ||
"grunt-contrib-jshint": "~0.6.0", | ||
"grunt-nodemon": "0.0.8", | ||
"grunt-concurrent": "~0.3.0", | ||
"web-mocha": "0.0.10" | ||
} | ||
} | ||
"name": "mean", | ||
"description": "Mongo", | ||
"version": "1.0.0", | ||
"private": false, | ||
"author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support).", | ||
"engines": { | ||
"node": "0.10.x", | ||
"npm": "1.2.x" | ||
}, | ||
"scripts": { | ||
"start": "make start", | ||
"test": "make test", | ||
"postinstall": "node_modules/bower/bin/bower install" | ||
}, | ||
"dependencies": { | ||
"express": "latest", | ||
"jade": "latest", | ||
"mongoose": "latest", | ||
"connect-mongo": "latest", | ||
"connect-flash": "latest", | ||
"passport": "latest", | ||
"passport-local": "latest", | ||
"passport-facebook": "latest", | ||
"passport-twitter": "latest", | ||
"passport-github": "latest", | ||
"passport-google-oauth": "latest", | ||
"underscore": "latest", | ||
"async": "latest", | ||
"view-helpers": "latest", | ||
"mean-logger": "latest", | ||
"bower": "latest", | ||
"forever": "latest", | ||
"foreman": "0.0.25" | ||
}, | ||
"devDependencies": { | ||
"supertest": "latest", | ||
"should": "latest", | ||
"mocha": "latest", | ||
"web-mocha": "0.0.10", | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-compass": "~0.3.0", | ||
"grunt-contrib-watch": "~0.4.4", | ||
"grunt-contrib-jshint": "~0.6.0", | ||
"grunt-nodemon": "0.0.8", | ||
"grunt-concurrent": "~0.3.0" | ||
} | ||
} |
This file contains 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
This file contains 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,58 @@ | ||
/** | ||
* Module dependencies. | ||
*/ | ||
var should = require('should'), | ||
app = require('../../server'), | ||
mongoose = require('mongoose'), | ||
User = mongoose.model('User'), | ||
Article = mongoose.model('Article'); | ||
|
||
//Globals | ||
var user; | ||
var article; | ||
|
||
//The tests | ||
describe('<Unit Test>', function() { | ||
describe('Model Article:', function() { | ||
beforeEach(function(done) { | ||
user = new User({ | ||
name: 'Full name', | ||
email: 'test@test.com', | ||
username: 'user', | ||
password: 'password' | ||
}); | ||
|
||
user.save(function(err) { | ||
article = new Article({ | ||
title: 'Article Title', | ||
content: 'Article Content', | ||
user: user | ||
}); | ||
|
||
done(); | ||
}); | ||
}); | ||
|
||
describe('Method Save', function() { | ||
it('should be able to save whithout problems', function(done) { | ||
return article.save(function(err) { | ||
should.not.exist(err); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should be able to show an error when try to save witout title', function(done) { | ||
article.title = ''; | ||
|
||
return article.save(function(err) { | ||
should.exist(err); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
afterEach(function(done) { | ||
done(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.