mirror of
https://github.com/upgundecha/howtheysre
synced 2026-01-04 08:18:02 +00:00
Quick improvements to test
This commit is contained in:
8
.github/workflows/workflow.yml
vendored
8
.github/workflows/workflow.yml
vendored
@@ -9,14 +9,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: markdown lit
|
- name: markdown lit
|
||||||
uses: nosborn/github-action-markdown-cli@v1.1.1
|
uses: nosborn/github-action-markdown-cli@v1.1.1
|
||||||
with:
|
with:
|
||||||
files: README.md
|
files: README.md
|
||||||
config_file: ".markdownlint.json"
|
config_file: ".markdownlint.json"
|
||||||
- name: tests
|
|
||||||
|
- name: Checklist
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '12.x'
|
node-version: '12.x'
|
||||||
- run: npm ci
|
run: npm ci && npm test
|
||||||
- run: npm test
|
|
||||||
@@ -8,32 +8,34 @@ var expect = chai.expect;
|
|||||||
|
|
||||||
const srcMd = fs.readFileSync('README.md', 'utf8');
|
const srcMd = fs.readFileSync('README.md', 'utf8');
|
||||||
|
|
||||||
describe('Header', function () {
|
describe('Checklist', function () {
|
||||||
it('is intact', function () {
|
describe('Header', function () {
|
||||||
expect(srcMd).to.startsWith('# How they SRE');
|
it('is intact', function () {
|
||||||
|
expect(srcMd).to.startsWith('# How they SRE');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe('Section Headers', function () {
|
describe('Section Headers', function () {
|
||||||
it('intact', function () {
|
it('intact', function () {
|
||||||
var expectedH2List = [
|
var expectedH2List = [
|
||||||
'## Introduction',
|
'## Introduction',
|
||||||
'## Organizations',
|
'## Organizations',
|
||||||
'## SRECon Mix Playlist',
|
'## SRECon Mix Playlist',
|
||||||
'## Resources',
|
'## Resources',
|
||||||
'## Credits',
|
'## Credits',
|
||||||
'## Other How They... repos',
|
'## Other How They... repos',
|
||||||
'## Contribute',
|
'## Contribute',
|
||||||
'## License'
|
'## License'
|
||||||
]
|
]
|
||||||
var actualList = srcMd.match(/^## (.*$)/gim);
|
var actualList = srcMd.match(/^## (.*$)/gim);
|
||||||
expect(expectedH2List).to.equalTo(actualList)
|
expect(actualList).to.equalTo(expectedH2List)
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe('Organization list', function () {
|
describe('Organization list', function () {
|
||||||
it('is sorted', function () {
|
it('is sorted', function () {
|
||||||
var orgList = srcMd.match(/(?<=<summary>)(.*?)(?=<\/summary>)/g);
|
var orgList = srcMd.match(/(?<=<summary>)(.*?)(?=<\/summary>)/g);
|
||||||
expect(orgList).to.be.sorted(Intl.Collator().compare);
|
expect(orgList).to.be.sorted(Intl.Collator().compare);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user