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

Commit 61ed090

Browse files
committed
Adds test to check license end year.
1 parent 5bb4cca commit 61ed090

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/test.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,19 @@ describe('nodejs-http-client repo', function() {
319319
throw e;
320320
}
321321
}
322-
});
322+
})
323+
324+
describe('LICENSE', function() {
325+
it('should have correct end year', function(done) {
326+
var licenseFile = fs.readFileSync('LICENSE.md', 'utf8')
327+
var licenseYearRange = licenseFile.split('\n')[2].split(' ')[2]
328+
var endYear = licenseYearRange.split('-')[1]
329+
var thisYear = (new Date()).getFullYear()
330+
331+
if (endYear != thisYear) {
332+
assert.fail(thisYear, endYear, "LICENSE end year is not correct")
333+
} else {
334+
done()
335+
}
336+
})
337+
})

0 commit comments

Comments
 (0)