(test)
| 65 | } |
| 66 | |
| 67 | runTest(test) { |
| 68 | try { |
| 69 | this.parse(test, parser); |
| 70 | test.actualError = false; |
| 71 | } catch (err) { |
| 72 | test.actualError = true; |
| 73 | test.actualErrorObject = err; |
| 74 | } |
| 75 | |
| 76 | test.result = test.expectedError !== test.actualError ? "fail" : "pass"; |
| 77 | |
| 78 | return test; |
| 79 | } |
| 80 | |
| 81 | parse(test, parser) { |
| 82 | const tests = typeof test.contents === "string" ? [test] : test.contents; |