Tests for OOP: Inherit Behaviors from a Supertype (#34938)
* Tests for OOP: Inherit Behaviors from a Supertype Fixes issue #34905 * fix: make test inclusive
This commit is contained in:
committed by
Ahmad Abdolsaheb
parent
f2c3d635ef
commit
9a4e13954a
@ -32,6 +32,10 @@ tests:
|
|||||||
testString: assert(typeof duck !== "undefined", 'The <code>duck</code> variable should be defined.');
|
testString: assert(typeof duck !== "undefined", 'The <code>duck</code> variable should be defined.');
|
||||||
- text: The <code>beagle</code> variable should be defined.
|
- text: The <code>beagle</code> variable should be defined.
|
||||||
testString: assert(typeof beagle !== "undefined", 'The <code>beagle</code> variable should be defined.');
|
testString: assert(typeof beagle !== "undefined", 'The <code>beagle</code> variable should be defined.');
|
||||||
|
- text: The <code>duck</code> variable should be initialised with <code>Object.create</code>.
|
||||||
|
testString: assert(/(let|const|var)\s*beagle\s*=\s*Object\.create\s*\(\s*Animal\.prototype\s*\)\s*;/.test(code), 'The <code>duck</code> variable should be initialised with <code>Object.create</code>');
|
||||||
|
- text: The <code>beagle</code> variable should be initialised with <code>Object.create</code>.
|
||||||
|
testString: assert(/(let|const|var)\s*duck\s*=\s*Object\.create\s*\(\s*Animal\.prototype\s*\)\s*;/.test(code), 'The <code>beagle</code> variable should be initialised with <code>Object.create</code>.');
|
||||||
- text: <code>duck</code> should have a <code>prototype</code> of <code>Animal</code>.
|
- text: <code>duck</code> should have a <code>prototype</code> of <code>Animal</code>.
|
||||||
testString: assert(duck instanceof Animal, '<code>duck</code> should have a <code>prototype</code> of <code>Animal</code>.');
|
testString: assert(duck instanceof Animal, '<code>duck</code> should have a <code>prototype</code> of <code>Animal</code>.');
|
||||||
- text: <code>beagle</code> should have a <code>prototype</code> of <code>Animal</code>.
|
- text: <code>beagle</code> should have a <code>prototype</code> of <code>Animal</code>.
|
||||||
|
Reference in New Issue
Block a user