hapijs / hapijs/lab

Use diffWordsWithSpace instead of diffWords in the console reporter

Open
#1,055 1 comment 0 reactions 0 assignees View on GitHub
support
Dominant language
JavaScript
Stars
736
Forks
177
PR merge metrics
No merged PRs in 30d

Description

#### Support plan

* *is this issue currently blocking your project?* (yes/no): no
* *is this issue affecting a production system?* (yes/no): yes

#### Context

* *node version*: 16.7.0
* *module version with issue*: 24.3.2
* *last module version without issue*: none
* *environment* (e.g. node, browser, native): node
* *used with* (e.g. hapi application, another framework, standalone, ...): hapi
* *any other relevant information*: I think it's due to a bug https://github.com/kpdecker/jsdiff/issues/236

#### What are you trying to achieve or the steps to reproduce?

I believe it would be more helpful if white space were to be colored to indicate changes. This is even more problematic when a non break space is in the place of a regular space, so that you can't even see "two spaces" vs "one space"

```js
test.only('default', async (done) => {
expect('word1 word2 word3').to.equal('word1 word2 word4')
});
```

#### What was the result you got?
![image](https://user-images.githubusercontent.com/1111617/180010930-34bacdb9-cee2-4236-8c63-4498703e6f0d.png)

#### What result did you expect?
![image](https://user-images.githubusercontent.com/1111617/180016010-dc1df500-0ac1-48bb-87bf-d8515d09865b.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.