Skip to content

Commit 9ec9fee

Browse files
committed
chore(build) Enable Windows CI
Signed-off-by: Jerome Simeon <[email protected]>
1 parent a3a31cc commit 9ec9fee

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

.travis.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
language: node_js
22
node_js:
33
- '8'
4-
dist: trusty
4+
matrix:
5+
include:
6+
- os: linux
7+
dist: trusty
8+
- os: windows
59
before_install: |
610
set -e
711
export PATH="./$HOME/node_modules/.bin:$PATH"
@@ -15,16 +19,15 @@ install: |
1519
date
1620
script: npm run test 2>&1
1721
deploy:
18-
provider: script
19-
script:
20-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./.travis/deploy.sh; fi'
21-
skip_cleanup: true
22-
on:
23-
all_branches: true
24-
repo: accordproject/markdown-transform
22+
provider: script
23+
script: 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./.travis/deploy.sh; fi'
24+
skip_cleanup: true
25+
on:
26+
all_branches: true
27+
repo: accordproject/markdown-transform
28+
condition: "$TRAVIS_OS_NAME = linux"
2529
after_failure: tail -n +1 -- /home/travis/.npm/_logs/*-debug.log
2630
after_success:
2731
cache:
2832
directories:
2933
- node_modules
30-
services:

packages/markdown-cli/test/cli.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ chai.use(require('chai-as-promised'));
2424

2525
const Commands = require('../lib/Commands');
2626

27+
/**
28+
* Prepare the text for parsing (normalizes new lines, etc)
29+
* @param {string} input - the text for the clause
30+
* @return {string} - the normalized text for the clause
31+
*/
32+
function normalizeNLs(input) {
33+
// we replace all \r and \n with \n
34+
let text = input.replace(/\r/gm,'');
35+
return text;
36+
}
37+
2738
describe('markdown-cli', () => {
2839
const sample = path.resolve(__dirname, 'data', 'acceptance.md');
2940
const sampleExpected = path.resolve(__dirname, 'data', 'acceptance.json');
@@ -32,7 +43,7 @@ describe('markdown-cli', () => {
3243
const sampleExpectedCiceroMarkJson = JSON.parse(fs.readFileSync(sampleExpectedCiceroMark, 'utf8'));
3344
const sampleExpectedSlate = path.resolve(__dirname, 'data', 'acceptance-slate.json');
3445
const sampleExpectedSlateJson = JSON.parse(fs.readFileSync(sampleExpectedSlate, 'utf8'));
35-
const sampleExpectedText = fs.readFileSync(path.resolve(__dirname, 'data', 'acceptance-roundtrip.md'), 'utf8');
46+
const sampleExpectedText = normalizeNLs(fs.readFileSync(path.resolve(__dirname, 'data', 'acceptance-roundtrip.md'), 'utf8'));
3647

3748
describe('#parse', () => {
3849
it('should parse a markdown file to CommonMark', async () => {

0 commit comments

Comments
 (0)