| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c5740f9 commit e4854fc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,8 @@ assert.strictEqual(test_object.readwriteValue, 1); | |||
| 13 | 13 | test_object.readwriteValue = 2; | |
| 14 | 14 | assert.strictEqual(test_object.readwriteValue, 2); | |
| 15 | 15 | ||
| 16 | - assert.throws(() => { test_object.readonlyValue = 3; }, TypeError); | ||
| 16 | + assert.throws(() => { test_object.readonlyValue = 3; }, | ||
| 17 | + /^TypeError: Cannot assign to read only property 'readonlyValue' of object '#<MyObject>'$/); | ||
| 17 | 18 | ||
| 18 | 19 | assert.ok(test_object.hiddenValue); | |
| 19 | 20 | ||
@@ -35,11 +36,13 @@ assert.ok(!propertyNames.includes('readonlyAccessor2')); | |||
| 35 | 36 | test_object.readwriteAccessor1 = 1; | |
| 36 | 37 | assert.strictEqual(test_object.readwriteAccessor1, 1); | |
| 37 | 38 | assert.strictEqual(test_object.readonlyAccessor1, 1); | |
| 38 | - assert.throws(() => { test_object.readonlyAccessor1 = 3; }, TypeError); | ||
| 39 | + assert.throws(() => { test_object.readonlyAccessor1 = 3; }, | ||
| 40 | + /^TypeError: Cannot assign to read only property 'readonlyAccessor1' of object '#<MyObject>'$/); | ||
| 39 | 41 | test_object.readwriteAccessor2 = 2; | |
| 40 | 42 | assert.strictEqual(test_object.readwriteAccessor2, 2); | |
| 41 | 43 | assert.strictEqual(test_object.readonlyAccessor2, 2); | |
| 42 | - assert.throws(() => { test_object.readonlyAccessor2 = 3; }, TypeError); | ||
| 44 | + assert.throws(() => { test_object.readonlyAccessor2 = 3; }, | ||
| 45 | + /^TypeError: Cannot assign to read only property 'readonlyAccessor2' of object '#<MyObject>'$/); | ||
| 43 | 46 | ||
| 44 | 47 | // validate that static properties are on the class as opposed | |
| 45 | 48 | // to the instance | |
| Back | FazBrowse Home | New Git URL |
0 commit comments