get-date-format
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -5,3 +5,3 @@ module.exports = { | ||
node: true, | ||
mocha: true | ||
jest: true | ||
}, | ||
@@ -8,0 +8,0 @@ extends: ["eslint:recommended", "prettier"], |
@@ -11,4 +11,2 @@ 'use strict'; | ||
var _chai = require('chai'); | ||
var _moment = require('moment'); | ||
@@ -27,3 +25,3 @@ | ||
var result = (0, _getDateFormat2.default)(samples); | ||
(0, _chai.expect)(result).to.equal(DATE_FORMAT); | ||
expect(result).toEqual(DATE_FORMAT); | ||
}); | ||
@@ -38,3 +36,3 @@ | ||
var result = (0, _getDateFormat2.default)(samples); | ||
(0, _chai.expect)(result).to.equal(DATE_FORMAT); | ||
expect(result).toEqual(DATE_FORMAT); | ||
}); | ||
@@ -49,5 +47,15 @@ | ||
var result = (0, _getDateFormat2.default)(samples); | ||
(0, _chai.expect)(result).to.equal(DATE_FORMAT); | ||
expect(result).toEqual(DATE_FORMAT); | ||
}); | ||
test('Should rebuild all posible formats based on input parameters', function () { | ||
var DATE_FORMAT = 'M/D/YY'; | ||
var sampleSize = 20; | ||
var start = (0, _moment2.default)('1/1/17', DATE_FORMAT); | ||
var samples = (0, _getSampleOfDates2.default)(start, sampleSize, DATE_FORMAT); | ||
var result = (0, _getDateFormat2.default)(samples, { dayFormats: ['D'] }); | ||
expect(result).toEqual(DATE_FORMAT); | ||
}); | ||
test('Should return null if it can`t find format', function () { | ||
@@ -57,7 +65,7 @@ var samples = ['foo', 'bar', '2017-01-01']; | ||
var result = (0, _getDateFormat2.default)(samples); | ||
(0, _chai.expect)(result).to.be.null; | ||
expect(result).toEqual(null); | ||
}); | ||
test('Should throw if sample of dates is not an array', function () { | ||
(0, _chai.expect)(_getDateFormat2.default.bind(null, 'someString')).to.throw('Date samples should be type of Array'); | ||
expect(_getDateFormat2.default.bind(null, 'someString')).toThrow('Date samples should be type of Array'); | ||
}); |
"use strict"; | ||
var _chai = require("chai"); | ||
var _getAllFormats = require("./getAllFormats"); | ||
@@ -20,3 +18,3 @@ | ||
var result = (0, _getAllFormats2.default)(input); | ||
(0, _chai.expect)(result).to.deep.equal(expected); | ||
expect(result).toEqual(expected); | ||
}); | ||
@@ -26,3 +24,3 @@ | ||
var formats = (0, _getAllFormats2.default)({}); | ||
(0, _chai.expect)(formats.length).to.be.equal(768); | ||
expect(formats.length).toEqual(768); | ||
}); |
'use strict'; | ||
var _chai = require('chai'); | ||
var _getSampleOfDates = require('./getSampleOfDates'); | ||
@@ -21,3 +19,3 @@ | ||
var value = (0, _getSampleOfDates2.default)(start, sampleSize, dateFormat); | ||
(0, _chai.expect)(value).to.deep.equal(expected); | ||
expect(value).toEqual(expected); | ||
}); |
{ | ||
"name": "get-date-format", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Module that tries to get the date format out of sample of dates", | ||
@@ -47,3 +47,2 @@ "main": "./dist/lib.js", | ||
"bind-infix-proxy": "^1.0.0", | ||
"chai": "^4.1.2", | ||
"cross-env": "^3.1.4", | ||
@@ -55,7 +54,4 @@ "eslint": "^4.7.2", | ||
"jsverify": "^0.7.4", | ||
"mocha": "^3.2.0", | ||
"mocha-webpack": "^0.7.0", | ||
"prettier": "^1.7.0", | ||
"source-map-support": "^0.4.11", | ||
"webpack": "^2.2.1" | ||
"source-map-support": "^0.4.11" | ||
}, | ||
@@ -62,0 +58,0 @@ "standard": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13428
17
186