Quality Assurance Projects - Issue Tracker

Tell us what’s happening:

Describe your issue in detail here.

I have finished the project. All test passed.
But there are some problem with my ‘functional tests’.

Test 1 - 11 have no problem.

Test 12 - 14 , however, when the assert.equal function find out that value of ‘expect’ and ‘actual’ do not match, it will throw out an error and make every test fail.

for example: test 12-1
if I change

.end((err, res) => {
                assert.equal(res.text,`{"result":"successfully deleted","_id":"${id1}"}`, `expect ${res.text} to be equal to '{"result":"successfully deleted","_id":"${id1}"}'`)
                done();
            })

to

.end((err, res) => {
                assert.equal(res.text,``, `expect ${res.text} to be equal to '{"result":"successfully deleted","_id":"${id1}"}'`)
                done();
            })

it will show text below and stop testing:

delete 65e98339fe16117969e57748


  0 passing (0ms)

{ result: 'successfully deleted', _id: '65e98339fe16117969e57748' }
    1) Delete an issue: DELETE request to /api/issues/{project}

/workspace/boilerplate-project-issuetracker/node_modules/mocha/lib/runner.js:936
    throw err;
    ^
AssertionError: expect {"result":"successfully deleted","_id":"65e98339fe16117969e57748"} to be equal to '{"result":"successfully deleted","_id":"65e98339fe16117969e57748"}': expected '{"result":"successfully deleted","_id":"65e98339fe16117969e57748"}' to equal ''
    at /workspace/boilerplate-project-issuetracker/tests/2_functional-tests.js:330:24
    at Request.callback (node_modules/superagent/lib/node/index.js:716:12)
    at /workspace/boilerplate-project-issuetracker/node_modules/superagent/lib/node/index.js:916:18
    at IncomingMessage.<anonymous> (node_modules/superagent/lib/node/parsers/json.js:19:7)
    at IncomingMessage.emit (node:events:530:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  showDiff: true,
  actual: '{"result":"successfully deleted","_id":"65e98339fe16117969e57748"}',
  expected: '',
  uncaught: true
}

I can not figure out why this happen, and I hope someone can explain it, thx!


another found:

if I change the order, for example, I change test 12 to the position between test 10 and test 11, no problems happen to test 12 , but to test 11.
Weird…

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Quality Assurance Projects - Issue Tracker

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.