Skip to content

Commit 29a7fb0

Browse files
author
Matt Bernier
authored
Merge pull request #62 from lvarayut/update-license
Add a unittest to check the license.md file date range
2 parents 1b3e724 + 4a5b824 commit 29a7fb0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/license.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
/**
4+
* Dependencies
5+
*/
6+
const fs = require("fs");
7+
const assert = require('assert');
8+
9+
/**
10+
* Tests
11+
*/
12+
describe('LICENSE', () => {
13+
it('should contain the current year as the end year of the license', () => {
14+
const license = fs.readFileSync(`${process.cwd()}/LICENSE.txt`, 'utf8');
15+
const currentYear= (new Date()).getFullYear();
16+
return assert(license.indexOf(`-${currentYear}`) !== -1);
17+
});
18+
});

0 commit comments

Comments
 (0)