You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I've been having a look at this and I'm a little unclear what the expected behavior should be for the format()method within std/testing/assets.ts module.
If I write a failing test which inputs 'John said, "Hello!" to Dave.' I will get the following output to the command line "John said, \"Hello!\" to Dave." .
As an example, this test:
test({name: "failed with string contains quote",fn(): void{assertThrows((): void=>assertEquals('John said, "Hello!" to Dave.','John said, "Hello" to Dave.'),
AssertionError,["Values are not equal:",
...createHeader(),removed(`- "John said, "Hello!" to Dave."`),added(`+ "John said, "Hello" to Dave."`),"",].join("\n"));},});
Will produce this output:
Is the replace() method actually required here given the string is inside a template literal?
string=`"${string.replace(/(?=["\\])/g,"\\")}"`;
If it is removed it resolves this issue and does not seem to break any other tests. It would be great to get some clarification on what the expected behavior is as it will influence how tests are written generally.
The text was updated successfully, but these errors were encountered:
Hi I've been having a look at this and I'm a little unclear what the expected behavior should be for the
format()
method withinstd/testing/assets.ts
module.See related issues: #4023 and #4749
If I write a failing test which inputs
'John said, "Hello!" to Dave.'
I will get the following output to the command line"John said, \"Hello!\" to Dave."
.As an example, this test:
Will produce this output:
Is the
replace()
method actually required here given the string is inside a template literal?If it is removed it resolves this issue and does not seem to break any other tests. It would be great to get some clarification on what the expected behavior is as it will influence how tests are written generally.
The text was updated successfully, but these errors were encountered: