Closed dougludlow closed 7 years ago
This mostly LGTM, just needs a little cleanup.
@wesleycho how's that? I split the original test out into a few to better articulate the intent.
I think the test cases can be simplified - what is mainly of concern is whether you can grab the current parser (and thus the original one), and whether you can override the parser used. That way if a failure in the overriding is present, it is easily isolated by the tests.
So basically remove the "clears cached parsers when overridden" and we're good as it is implied in "can set a parser back to the original"?
The two specs should read
it('should get the current parser'
And
it('should override the parser'
Or something like that, and test those scenarios
Ok, simplified. I still think it's important to have a test for making sure that the parsers are cleared when a parser is overridden. Basically guarding against this line (https://github.com/dougludlow/bootstrap/blob/b02815b446ad03df6eeb8a7ac054b13d9669f579/src/dateparser/dateparser.js#L258) being removed. If they aren't cleared the overridden parser will not be used.
@wesleycho any other feedback here?
LGTM, going to schedule for 2.4.0
Proof of concept for #6370.