summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package.json7
-rw-r--r--south-african-id-parser.js2
-rw-r--r--test/test.js10
3 files changed, 15 insertions, 4 deletions
diff --git a/package.json b/package.json
index 3d6fb76..baf9734 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "A library for parsing and validating South African ID Numbers.",
"main": "south-african-id-parser.js",
"scripts": {
- "test": "mocha"
+ "test": "mocha && jshint **/*.js"
},
"keywords": [
"South Africa",
@@ -21,7 +21,8 @@
},
"license": "ISC",
"devDependencies": {
- "chai": "^3.4.1",
- "mocha": "^2.3.4"
+ "chai": "^4.0.2",
+ "mocha": "^3.4.2",
+ "jshint": "^2.9.5"
}
}
diff --git a/south-african-id-parser.js b/south-african-id-parser.js
index 1405a5a..b51d081 100644
--- a/south-african-id-parser.js
+++ b/south-african-id-parser.js
@@ -1,4 +1,6 @@
(function (global, factory) {
+ 'use strict';
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.saIdParser = factory();
diff --git a/test/test.js b/test/test.js
index 01fe3fd..32a8358 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,7 +1,15 @@
+'use strict';
+/*jshint
+ node: true
+*/
+
+var mocha = require('mocha');
+var describe = mocha.describe;
+var it = mocha.it;
var expect = require('chai').expect;
var saIdParser = require('../south-african-id-parser.js');
-describe('South African ID Number Parsing', function() {
+describe('South African ID Number Parsing', function () {
var validIdNumbers = [{
idNumber: '9001049818080',
dateOfBirth: new Date(1990, 0, 4),