Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

Commit d2343bd

Browse files
committed
Adds test to check license end year.
1 parent ce24cec commit d2343bd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var assert = require('chai').assert
22
var nock = require('nock')
3+
var fs = require('fs')
34

45
var TEST_HOST = 'https://api.test.com'
56

@@ -241,3 +242,18 @@ describe('Client', function () {
241242
})
242243
})
243244
})
245+
246+
describe('LICENSE', function() {
247+
it('should have correct end year', function(done) {
248+
var licenseFile = fs.readFileSync('LICENSE.txt', 'utf8')
249+
var licenseYearRange = licenseFile.split('\n')[2].split(' ')[2]
250+
var endYear = licenseYearRange.split('-')[1]
251+
var thisYear = (new Date()).getFullYear()
252+
253+
if (endYear != thisYear) {
254+
assert.fail(thisYear, endYear, "LICENSE end year is not correct")
255+
} else {
256+
done()
257+
}
258+
})
259+
})

0 commit comments

Comments
 (0)