Change:
A user can fail with correct code because the tests secretly rely upon global variables accessible to the user. This code fails because the user has the correct solution but deleted the instantiation of the object. Tests should instantiate any data they need. We should update the seed code to We should then add and modify the test suite to use instead of . No response All No response
Hello, Just to clarify, did you want to add in the user code block? Because I noticed when I attempted to reproduce the bug you encountered that two test cases still passed, despite not being initialized in the user's code. I checked the lesson's markdown file and found out that those two test cases did have their own initialized. I was thinking of adding to all the test cases instead. For reference, here's the code for one of the test cases that still passed, despite the bug.
Those tests initiate their own values so they are fine. I'm talking about the tests that fail if users modify their seed code to not have the object initialization. The new variable would go into a new --after-user-code-- part; that's not currently present. Just adding this new variable inside of the seed creates the exact same problem. Note - this issue isn't marked as ready for contributions yet. Maybe we should review if the tests logic too to see if they are independent
Opening this up for contribution.
Hi assign this issue for branch bugfix/. I have resolved it, need to create PR for same
We don't assign issues. The first PR that fully covers the issue will be accepted.
Hi ok !! I have raised PR . thanks for reply.

Discussion:
`bob instanceof Person` should return `true`. ```js <del> assert.deepEqual(bob instanceof Person, true); </del> <ins> assert.deepEqual(_test_bob instanceof Person, true); </ins> ``` `bob.firstName` should return `undefined`. ```js <del> assert.deepEqual(bob.firstName, undefined); </del> <ins> assert.deepEqual(_test_bob.firstName, undefined); </ins> ``` `bob.lastName` should return `undefined`. ```js <del> assert.deepEqual(bob.lastName, undefined); </del> <ins> assert.deepEqual(_test_bob.lastName, undefined); </ins> ``` `bob.getFirstName()` should return the string `Bob`. ```js <del> assert.deepEqual(bob.getFirstName(), 'Bob'); </del> <ins> assert.deepEqual(_test_bob.getFirstName(), 'Bob'); </ins> ``` `bob.getLastName()` should return the string `Ross`. ```js <del> assert.deepEqual(bob.getLastName(), 'Ross'); </del> <ins> assert.deepEqual(_test_bob.getLastName(), 'Ross'); </ins> ``` `bob.getFullName()` should return the string `Bob Ross`. ```js <del> assert.deepEqual(bob.getFullName(), 'Bob Ross'); </del> <ins> assert.deepEqual(_test_bob.getFullName(), 'Bob Ross'); </ins> ``` `bob.getFullName()` should return the string `Haskell Ross` after `bob.setFirstName("Haskell")`.

```js assert.strictEqual( (function () { <del> bob.setFirstName('Haskell'); return bob.getFullName(); </del> <ins> _test_bob.setFirstName('Haskell'); return _test_bob.getFullName(); </ins> })(), 'Haskell Ross' );

```js assert.strictEqual( (function () { <del> bob.setFullName('Haskell Curry'); return bob.getFullName(); </del> <ins> _test_bob.setFullName('Haskell Curry'); return _test_bob.getFullName(); </ins> })(), 'Haskell Curry' );

```js assert.strictEqual( (function () { <del> bob.setFullName('Haskell Curry'); return bob.getFirstName(); </del> <ins> _test_bob.setFullName('Haskell Curry'); return _test_bob.getFirstName(); </ins> })(), 'Haskell' );

```js assert.strictEqual( (function () { <del> bob.setFullName('Haskell Curry'); return bob.getLastName(); </del> <ins> _test_bob.setFullName('Haskell Curry'); return _test_bob.getLastName(); </ins> })(), 'Curry' );

# --seed-- <ins> ## --after-user-code-- ```js const _test_bob = new Person('Bob Ross'); ``` </ins> ## --seed-contents-- ```js const Person = function(firstAndLast) { <del> // Only change code below this line // Complete the method below and implement the others similarly </del> this.getFullName = function() { return ""; };