Build a Cargo Manifest Validator - Build a Cargo Manifest Validator

Tell us what’s happening:

Build a Cargo Manifest Validator - Output seems right

Your code so far

// running tests
15. If the input manifest object is not valid, your validateManifest function should return an object describing missing and/or invalid properties.
22. Calling processManifest() with { containerId: -88, destination: "Soledad", weight: NaN } should first log Validation error: -88 and then log the object { containerId: "Invalid", weight: "Invalid", unit: "Missing", hazmat: "Missing" }.
23. Calling processManifest() with { destination: "Watsonville", hazmat: true } should first log Validation error: undefined and then log the object { containerId: "Missing", weight: "Missing", unit: "Missing" }.
24. If the input manifest object is not valid, your processManifest function should first log the error message, Validation error: ${containerId}.
26. If the input manifest object is not valid, your processManifest function should log an error message with the object's containerId, and then log the object returned by calling validateManifest() with the input object. This should involve two console.log() calls.

the code and output seems right but test output doesnt agree T^T

testProbe_6
Validation success: 1
Total weight: 304 kg

testProbe_8
Validation error: undefined
{ containerId: 'Missing',
  destination: 'Missing',
  weight: 'Missing',
  unit: 'Missing',
  hazmat: 'Missing' }

testProbe_9
Validation error: undefined
{ containerId: 'Invalid' }

testProbe_10
Validation error: 0
{ containerId: 'Invalid',
  destination: 'Invalid',
  weight: 'Invalid',
  unit: 'Invalid',
  hazmat: 'Invalid' }

testProbe_11
Validation error: -2
{ containerId: 'Invalid',
  destination: 'Missing',
  weight: 'Missing',
  unit: 'Missing',
  hazmat: 'Missing' }

testProbe_12
Validation error: 3.5
{ containerId: 'Invalid',
  destination: 'Missing',
  weight: 'Missing',
  unit: 'Missing',
  hazmat: 'Missing' }

testProbe_13
Validation error: undefined
{ destination: 'Invalid',
  containerId: 'Missing',
  weight: 'Missing',
  unit: 'Missing',
  hazmat: 'Missing' }

testProbe_14
Validation error: undefined
{ weight: 'Invalid',
  containerId: 'Missing',
  destination: 'Missing',
  unit: 'Missing',
  hazmat: 'Missing' }

testProbe_18
Validation success: 55
Total weight: 180 kg

testProbe_22
Validation error: -88
{ containerId: 'Invalid',
  weight: 'Invalid',
  unit: 'Missing',
  hazmat: 'Missing' }

testProbe_23
Validation error: undefined
{ containerId: 'Missing', weight: 'Missing', unit: 'Missing' }

Welcome to the forum @mj.josel1013,

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

Happy coding

Thank you for the warm welcome. The issue has been resolved after looking on the actual and expected result. :smiley:

this fixed the errors

code removed by moderator

Congratulations on solving the challenge! You should be proud of your achievement…we are! But we are removing your working solution, so it is not available to others who have not yet done the work to get there. Again, congrats!