Adding failure paths for all async tests

This will ensure the tests fail if the intended path isn't followed
This commit is contained in:
Jeff Avallone 2014-12-27 16:04:22 -05:00
parent 9a412b6b3e
commit 08fdb254fc
12 changed files with 47 additions and 47 deletions

View File

@ -95,7 +95,7 @@ describe('parser/javascript/charset_range.js', function() {
'hyphen',
this.node.last
], { padding: 5 });
})
}, fail)
.finally(done)
.done();
});

View File

@ -143,7 +143,7 @@ describe('parser/javascript/charset.js', function() {
this.node._render()
.then(() => {
expect(util.spaceVertically).toHaveBeenCalledWith(this.node.elements, { padding: 5 });
})
}, fail)
.finally(done)
.done();
});
@ -153,7 +153,7 @@ describe('parser/javascript/charset.js', function() {
.then(result => {
expect(this.node.renderLabeledBox).toHaveBeenCalledWith('example label', this.partContainer, { padding: 5 });
expect(result).toEqual('labeled box promise');
})
}, fail)
.finally(done)
.done();
});

View File

@ -63,7 +63,7 @@ describe('parser/javascript/escape.js', function() {
rx: '3',
ry: '3'
}));
})
}, fail)
.finally(done)
.done();
});

View File

@ -43,7 +43,7 @@ describe('parser/javascript/literal.js', function() {
.then(label => {
expect(label.selectAll('tspan')[0].hasClass('quote')).toBeTruthy();
expect(label.selectAll('tspan')[2].hasClass('quote')).toBeTruthy();
})
}, fail)
.finally(done)
.done();
});
@ -55,7 +55,7 @@ describe('parser/javascript/literal.js', function() {
rx: '3',
ry: '3'
}));
})
}, fail)
.finally(done)
.done();
});

View File

@ -99,7 +99,7 @@ describe('parser/javascript/match_fragment.js', function() {
this.node._render()
.then(() => {
expect(this.node.content.transform).toHaveBeenCalledWith('example position');
})
}, fail)
.finally(done)
.done();
});
@ -110,7 +110,7 @@ describe('parser/javascript/match_fragment.js', function() {
expect(this.node.skipPath).toHaveBeenCalledWith('content bbox');
expect(this.node.loopPath).toHaveBeenCalledWith('content bbox');
expect(this.node.container.path).toHaveBeenCalledWith('skip pathloop path');
})
}, fail)
.finally(done)
.done();
});
@ -119,7 +119,7 @@ describe('parser/javascript/match_fragment.js', function() {
this.node._render()
.then(() => {
expect(this.node.loopLabel).toHaveBeenCalled();
})
}, fail)
.finally(done)
.done();
});

View File

@ -215,7 +215,7 @@ describe('parser/javascript/match.js', function() {
.then(() => {
expect(this.node.start).toEqual('start label');
expect(this.node.end).toEqual('end label');
})
}, fail)
.finally(done)
.done();
});
@ -230,7 +230,7 @@ describe('parser/javascript/match.js', function() {
'part 2',
'end label'
], { padding: 10 });
})
}, fail)
.finally(done)
.done();
});
@ -246,7 +246,7 @@ describe('parser/javascript/match.js', function() {
'end label'
]);
expect(this.node.container.path).toHaveBeenCalledWith('connector paths');
})
}, fail)
.finally(done)
.done();
});

View File

@ -126,7 +126,7 @@ describe('parser/javascript/node.js', function() {
.then(() => {
expect(resolve).toHaveBeenCalledWith('result');
expect(reject).not.toHaveBeenCalled();
})
}, fail)
.finally(done)
.done();
});
@ -141,7 +141,7 @@ describe('parser/javascript/node.js', function() {
.then(() => {
expect(resolve).not.toHaveBeenCalled();
expect(reject).toHaveBeenCalledWith('Render cancelled');
})
}, fail)
.finally(done)
.done();
});
@ -193,7 +193,7 @@ describe('parser/javascript/node.js', function() {
.then(() => {
expect(this.text.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(5, 22));
})
}, fail)
.finally(done)
.done();
});
@ -205,7 +205,7 @@ describe('parser/javascript/node.js', function() {
width: 52,
height: 34
});
})
}, fail)
.finally(done)
.done();
});
@ -214,7 +214,7 @@ describe('parser/javascript/node.js', function() {
this.node.renderLabel('example label')
.then(group => {
expect(group).toEqual(this.group);
})
}, fail)
.finally(done)
.done();
});
@ -331,7 +331,7 @@ describe('parser/javascript/node.js', function() {
this.node.render(this.container)
.then(() => {
expect(this.node.doneRender).toHaveBeenCalled();
})
}, fail)
.finally(done)
.done();
});
@ -340,7 +340,7 @@ describe('parser/javascript/node.js', function() {
this.node.render(this.container)
.then(result => {
expect(result).toEqual(this.node);
})
}, fail)
.finally(done)
.done();
});
@ -418,7 +418,7 @@ describe('parser/javascript/node.js', function() {
.then(() => {
expect(this.text.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(0, 20));
})
}, fail)
.finally(done)
.done();
});
@ -429,7 +429,7 @@ describe('parser/javascript/node.js', function() {
.then(() => {
expect(this.rect.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(0, 20));
})
}, fail)
.finally(done)
.done();
});
@ -442,7 +442,7 @@ describe('parser/javascript/node.js', function() {
width: 210,
height: 110
})
})
}, fail)
.finally(done)
.done();
});
@ -460,7 +460,7 @@ describe('parser/javascript/node.js', function() {
width: 100,
height: 110
})
})
}, fail)
.finally(done)
.done();
});
@ -471,7 +471,7 @@ describe('parser/javascript/node.js', function() {
.then(() => {
expect(this.content.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(5, 25));
})
}, fail)
.finally(done)
.done();
});

View File

@ -104,7 +104,7 @@ describe('parser/javascript/regexp.js', function() {
this.node._render()
.then(() => {
expect(util.spaceVertically).toHaveBeenCalledWith(this.node.matches, { padding: 5 });
})
}, fail)
.finally(done)
.done();
});
@ -118,7 +118,7 @@ describe('parser/javascript/regexp.js', function() {
expect(this.node.makeSide).toHaveBeenCalledWith('container bbox', this.node.matches[0]);
expect(this.node.makeSide).toHaveBeenCalledWith('container bbox', this.node.matches[2]);
expect(this.node.container.path).toHaveBeenCalledWith('curvecurvecurvesideside');
})
}, fail)
.finally(done)
.done();
});
@ -130,7 +130,7 @@ describe('parser/javascript/regexp.js', function() {
expect(this.node.makeConnector).toHaveBeenCalledWith('group bbox', this.node.matches[1]);
expect(this.node.makeConnector).toHaveBeenCalledWith('group bbox', this.node.matches[2]);
expect(this.group.path).toHaveBeenCalledWith('connectorconnectorconnector');
})
}, fail)
.finally(done)
.done();
});

View File

@ -114,7 +114,7 @@ describe('parser/javascript/root.js', function() {
this.node._render()
.then(() => {
expect(this.node.container.path).toHaveBeenCalledWith('M1,2H0M3,2H14');
})
}, fail)
.finally(done)
.done();
});
@ -124,7 +124,7 @@ describe('parser/javascript/root.js', function() {
.then(() => {
expect(this.node.container.circle).toHaveBeenCalledWith(0, 2, 5);
expect(this.node.container.circle).toHaveBeenCalledWith(14, 2, 5);
})
}, fail)
.finally(done)
.done();
});
@ -140,7 +140,7 @@ describe('parser/javascript/root.js', function() {
.then(() => {
expect(this.node.regexp.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(10, 20));
})
}, fail)
.finally(done)
.done();
});
@ -158,7 +158,7 @@ describe('parser/javascript/root.js', function() {
.then(() => {
expect(this.node.regexp.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(10, 0));
})
}, fail)
.finally(done)
.done();
});

View File

@ -92,7 +92,7 @@ describe('parser/javascript/subexp.js', function() {
this.node._render()
.then(() => {
expect(this.node.renderLabeledBox).toHaveBeenCalledWith('example label', this.node.regexp, { padding: 10 });
})
}, fail)
.finally(done)
.done();
});

View File

@ -19,7 +19,7 @@ describe('parser/javascript.js', function() {
this.parser.parse('example expression')
.then(() => {
expect(regexpParser.parse).toHaveBeenCalledWith('example expression');
})
}, fail)
.finally(done)
.done();
});
@ -28,7 +28,7 @@ describe('parser/javascript.js', function() {
this.parser.parse('multiline\nexpression')
.then(() => {
expect(regexpParser.parse).toHaveBeenCalledWith('multiline\\nexpression');
})
}, fail)
.finally(done)
.done();
});
@ -37,7 +37,7 @@ describe('parser/javascript.js', function() {
this.parser.parse('example expression')
.then(result => {
expect(result).toEqual(this.parser);
})
}, fail)
.finally(done)
.done();
});
@ -46,7 +46,7 @@ describe('parser/javascript.js', function() {
this.parser.parse('/example')
.then(null, result => {
expect(result).toBeDefined();
})
}, fail)
.finally(done)
.done();
});
@ -99,7 +99,7 @@ describe('parser/javascript.js', function() {
.then(() => {
expect(this.result.transform).toHaveBeenCalledWith(Snap.matrix()
.translate(6, 8));
})
}, fail)
.finally(done)
.done();
});
@ -111,7 +111,7 @@ describe('parser/javascript.js', function() {
expect(svg.getAttribute('width')).toEqual('62');
expect(svg.getAttribute('height')).toEqual('44');
})
}, fail)
.finally(done)
.done();
});

View File

@ -446,7 +446,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.parser.render).toHaveBeenCalledWith(this.regexper.svgContainer, this.regexper.svgBase);
})
}, fail)
.finally(done)
.done();
});
@ -465,7 +465,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper.state).toEqual('has-results');
})
}, fail)
.finally(done)
.done();
});
@ -474,7 +474,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper.updateLinks).toHaveBeenCalled();
})
}, fail)
.finally(done)
.done();
});
@ -483,7 +483,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper.displayWarnings).toHaveBeenCalled();
})
}, fail)
.finally(done)
.done();
});
@ -492,7 +492,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper._trackEvent).toHaveBeenCalledWith('visualization', 'complete');
})
}, fail)
.finally(done)
.done();
});
@ -501,7 +501,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper.runningParser).toBeFalsy();
})
}, fail)
.finally(done)
.done();
});
@ -520,7 +520,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper.state).toEqual('');
})
}, fail)
.finally(done)
.done();
});
@ -529,7 +529,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper._trackEvent).toHaveBeenCalledWith('visualization', 'cancelled');
})
}, fail)
.finally(done)
.done();
});
@ -538,7 +538,7 @@ describe('regexper.js', function() {
this.regexper.renderRegexp('example expression')
.then(() => {
expect(this.regexper.runningParser).toBeFalsy();
})
}, fail)
.finally(done)
.done();
});