Commit Graph

16 Commits

Author SHA1 Message Date
Sujeeth
fb9d9d912c feat(user): add strict validations for username (#1574)
Idea proposed by @sparshy #1204
Suggestions, rules and tests from Trustroots @simison
Added validations on user server model
Added client side validations
Added relevant tests on user server tests
Added relevant tests on user e2e tests

Fixes #1204
2016-10-19 20:40:26 -07:00
Mikael Korpela
07a860f6b5 feat(angular): disable Angular debug data in production (#1457)
Disable Angular debug data in production for a significant performance
boost.

Passes environment variable from template to app config and from there
to
Angular bootstrap config.

https://docs.angularjs.org/guide/production#disabling-debug-data

See #1294
2016-08-28 14:52:05 +03:00
Liran Tal
c8cbcd326f feat(logs): replacing unmaintained and vulnerable file-stream-rotator package with winston log facility (#1334)
* replacing file-stream-rotator with a better logging mechanism using winston which can be extended later for other use cases and integrations

* refactoring logger mechanism, accomodating for tests and environment variable configurations

* only enabling morgan logger if config.log.format option was defined, and disabling the app.log file transport option for the test environment

* disabling all kind of logging when in test enviroment
2016-05-22 01:03:18 +03:00
Marek Grzybek
d14d5130af feat(config): Deprecate JSHint in favor of ESLint
Add basic ESLint setup extending well-known Airbnb code style.

Fixes #1072, #1097
2016-03-15 19:11:12 +01:00
Liran Tal
0744ce5d96 fix(tests) fixing assertion test for logger which failed on undefined variable 2015-12-28 10:24:32 +02:00
mleanos
8cd2291a6a Enable log options for Morgan
Adds the log options, and format to the Morgan middleware in the Express
configuration.

These options are defined in the environment configurations.

The implementation derived from https://github.com/meanjs/mean/pull/254
by @lirantal, which somehow got overlooked when merging 0.4.0 into
master.

Added tests for the Logger configuration.

Added the log settings to the Test env config.

Added environment variables for the log settings in the Test &
Production env configs.

Moved the Morgan Express middleware outside of the NODE_ENV ===
'development' check. Morgan should be used in all environments, and use
the settings set in each env config.

Changed the wording of the Stream option comments in the env configs.

Added Rotating Logs functionality, and refactored the log Stream
options. Added a new npm package, FileStreamRotator, for use with
Morgan's rotating logs functionality.

Also, refactored the log configuration tests to be more maintainable.

Added more tests, and refactored test suite to use mock-fs.
2015-10-20 21:03:07 -07:00
Ilan Biala
0323696eaf Format code according to ESLint rules 2015-10-16 20:52:31 -04:00
Liran Tal
e30c3d1249 Merge pull request #957 from mleanos/seeddb-enhance-testability
Seed options - logResults
2015-10-15 17:24:28 +03:00
mleanos
037878b4ba Global Mocha timeout
Added the timeout option to the Mocha grunt task; set to 10000.

Removed the individual test suite timeouts, for all server tests.

Also, added global timeout for Mocha gulp task.
2015-10-10 23:52:08 -07:00
mleanos
32e0d126ca Synchronous tests
Removed the done() callback method from the config tests that aren't
truly asynchronous.
2015-10-09 16:14:14 -07:00
mleanos
75cf74537a Formatting and Indentation
Changes to formatting and indentation.
2015-10-09 14:06:29 -07:00
mleanos
0560062eab Seed options - logResults
Added an options object to the database seed configuration. Currently,
the only option implemented is `logResults`; set using the seedDB env
config
options (default to "true").

Modified the definition of the env config for seedDB. It's now an
object, with
options.

Setting the logResults option is set to `false` in the core
configuration server test suite.

Also, fixed an issue with how env configs were reading the seedDB
setting from the env variables. Previously, the config was getting set
by
looking for merely the existence of the env variable (MONGO_SEED).
However,
if this setting existed but was set to "false", the seedDB would be
turned on.

Added the SeedDB user details to the env config, and seedDB options.

Added tests to the core server config test suite

should have seedDB configuration set for "regular" user
should have seedDB configuration set for admin user
should seed admin, and "regular" user accounts when NODE_ENV is set to
"test" when they already exist
should ONLY seed admin user account when NODE_ENV is set to "production"
with custom admin
should seed admin, and "regular" user accounts when NODE_ENV is set to
"test" with custom options
should NOT seed admin user account if it already exists when NODE_ENV is
set to "production"
should NOT seed "regular" user account if missing email when NODE_ENV
set to "test"

Added support for environment variables to seedDB env configs; currently
only supporting username & email.

Refactored how the SeedDB rejects were being handled
2015-10-09 13:48:11 -07:00
jloveland
b07af94255 adding return done() to tests 2015-10-09 12:45:16 -04:00
jloveland
2eb0b0970d adding ability to configure session.secret in local env config 2015-10-04 20:45:47 -04:00
mleanos
3b375e62d8 Mocha test timeouts [fixes #955]
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.

Issue is described in https://github.com/meanjs/mean/issues/955
2015-09-30 19:50:07 -07:00
Liran Tal
6f8b5bfd58 adding tests for meanjs core server functionality 2015-09-28 11:29:42 +03:00