From 4a5b8241e9f4ae651330a52c0b65359e14972561 Mon Sep 17 00:00:00 2001 From: Varayut Lerdkanlayanawat Date: Sat, 28 Oct 2017 23:23:50 +0200 Subject: [PATCH] Add a unittest to check the license.md file date range --- test/license.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/license.js diff --git a/test/license.js b/test/license.js new file mode 100644 index 0000000..27a9d5d --- /dev/null +++ b/test/license.js @@ -0,0 +1,18 @@ +'use strict'; + +/** + * Dependencies + */ +const fs = require("fs"); +const assert = require('assert'); + +/** + * Tests + */ +describe('LICENSE', () => { + it('should contain the current year as the end year of the license', () => { + const license = fs.readFileSync(`${process.cwd()}/LICENSE.txt`, 'utf8'); + const currentYear= (new Date()).getFullYear(); + return assert(license.indexOf(`-${currentYear}`) !== -1); + }); +});