]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Checking rfc2822 parsingFlags
authorTGJG-XPS\TracyG <tracyg.gilmore@gmail.com>
Mon, 6 Mar 2017 20:19:20 +0000 (20:19 +0000)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 12 Mar 2017 00:11:46 +0000 (02:11 +0200)
src/test/moment/create.js

index 43376f1bd496c334e299fd256c5667506d402c9e..7337da16eb59f6fabae0a8bd279993d0be0d8215 100644 (file)
@@ -471,6 +471,7 @@ test('parsing RFC 2822', function (assert) {
     for (testCase in testCases) {
         var testResult = moment(testCases[testCase], moment.RFC_2822, true);
         assert.ok(testResult.isValid(), testResult);
+        assert.ok(testResult.parsingFlags().rfc2822(), testResult + ' - rfc2822 parsingFlag');
     }
 });
 
@@ -484,6 +485,7 @@ test('non RFC 2822 strings', function (assert) {
     for (testCase in testCases) {
         var testResult = moment(testCases[testCase], moment.RFC_2822, true);
         assert.ok(!testResult.isValid(), testResult);
+        assert.ok(!testResult.parsingFlags().rfc2822(), testResult + ' - rfc2822 parsingFlag');
     }
 });