From 426d5092b80eca28517df455f70468d2e0fb1378 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 24 Jun 2017 19:54:05 +0200 Subject: Updated dev dependencies and added linting --- package.json | 7 ++++--- south-african-id-parser.js | 2 ++ test/test.js | 10 +++++++++- 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), -- cgit v1.2.3