-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add infrastructure for known failing tests
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import assert from "assert"; | ||
|
||
|
||
/** | ||
* The tests in this suite are known to fail, due to a bug in the library. If the tests here start | ||
* failing in the sense of mocha, then the test is passing and you have either: | ||
* | ||
* 1) Fixed the bug (yay! remove the test) | ||
* 2) Triggered some unknown underlying issue (boo! investigate) | ||
* | ||
* When adding something here, make sure to link the issue. | ||
*/ | ||
suite('Known failures', function() { | ||
function testKnownFailure(message, testFn, only) { | ||
let runner = only ? test.only : test; | ||
runner(message, function(done) { | ||
try { | ||
testFn(done); | ||
done(new Error("Expected test fo fail")); | ||
} catch (e) { | ||
if (e instanceof assert.AssertionError) { | ||
this.skip(); | ||
} else { | ||
done(e); | ||
} | ||
} | ||
}); | ||
} | ||
testKnownFailure.only = function(message, testFn) { | ||
return testKnownFailure(message, testFn, true); | ||
}; | ||
|
||
// Escaped parameters are not correctly parsed | ||
// Please see https://github.com/kewisch/ical.js/issues/669 | ||
testKnownFailure('Parameter escaping', function() { | ||
let subject = ICAL.Property.fromString(`ATTENDEE;CN="Z\\;":mailto:[email protected]`); | ||
assert.equal(subject.getParameter("cn"), "Z\\;"); | ||
assert.equal(subject.getFirstValue(), "mailto:[email protected]"); | ||
}); | ||
}); |