node-minecraft-protocol/test/docTest.js
Romain Beaumont 80d038bd61
Add test to make sure version that are tested are mentioned in the RE… (#1276)
* Add test to make sure version that are tested are mentioned in the README

* fix lint
2023-12-30 23:42:17 +01:00

16 lines
577 B
JavaScript

/* eslint-env mocha */
const mc = require('../')
const fs = require('fs')
const assert = require('assert')
const path = require('path')
const readmeContent = fs.readFileSync(path.join(__dirname, '/../docs/README.md'), { encoding: 'utf8', flag: 'r' })
for (const supportedVersion of mc.supportedVersions) {
describe('doc ' + supportedVersion + 'v', function () {
it('mentions the supported version in the readme', () => {
assert.ok(readmeContent.includes(supportedVersion), `${supportedVersion} should be mentionned in the README.md but it is not`)
})
})
}