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

Commit

Permalink
Adds test to check license end year.
Browse files Browse the repository at this point in the history
  • Loading branch information
mukulmishra18 committed Oct 28, 2017
1 parent ce24cec commit d2343bd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var assert = require('chai').assert
var nock = require('nock')
var fs = require('fs')

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

Expand Down Expand Up @@ -241,3 +242,18 @@ describe('Client', function () {
})
})
})

describe('LICENSE', function() {
it('should have correct end year', function(done) {
var licenseFile = fs.readFileSync('LICENSE.txt', 'utf8')
var licenseYearRange = licenseFile.split('\n')[2].split(' ')[2]
var endYear = licenseYearRange.split('-')[1]
var thisYear = (new Date()).getFullYear()

if (endYear != thisYear) {
assert.fail(thisYear, endYear, "LICENSE end year is not correct")
} else {
done()
}
})
})

0 comments on commit d2343bd

Please sign in to comment.