This repository was archived by the owner on Feb 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest.js
50 lines (44 loc) · 1.81 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict';
var conventionalChangelogCore = require('conventional-changelog-core');
var config = require('./');
var expect = require('chai').expect;
var shell = require('shelljs');
var through = require('through2');
var writeFileSync = require('fs').writeFileSync;
describe('eslint preset', function() {
before(function() {
shell.config.silent = true;
shell.rm('-rf', 'tmp');
shell.mkdir('tmp');
shell.cd('tmp');
shell.mkdir('git-templates');
shell.exec('git init --template=./git-templates');
writeFileSync('test1', '');
shell.exec('git add --all && git commit -m\'Fix: the `no-class-assign` rule (fixes #2718)\'');
writeFileSync('test2', '');
shell.exec('git add --all && git commit -m"Update: Handle CRLF line endings in spaced-comment rule - 2 (fixes #3005)"');
writeFileSync('test3', '');
shell.exec('git add --all && git commit -m"Fix: indent rule should recognize single line statements with ASI (fixes #3001, fixes #3000)"');
writeFileSync('test4', '');
shell.exec('git add --all && git commit -m"Docs: Fix unmatched paren in rule description"');
writeFileSync('test5', '');
shell.exec('git add --all && git commit -m"Merge pull request #3033 from gcochard/patch-3 "');
});
it('should work if there is no semver tag', function(done) {
conventionalChangelogCore({
config: config
})
.on('error', function(err) {
done(err);
})
.pipe(through(function(chunk) {
chunk = chunk.toString();
expect(chunk).to.include('the `no-class-assign` rule');
expect(chunk).to.include('### Fix');
expect(chunk).to.include('indent rule should recognize single line statements with ASI');
expect(chunk).to.include('### Docs');
expect(chunk).to.not.include('3033');
done();
}));
});
});