Skip to content

Commit

Permalink
Make more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Nechiporenko authored and Oleg Nechiporenko committed Feb 26, 2025
1 parent 97fe353 commit b179d3d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,36 @@ chai.use(require('chai-string'));
All assertions are defined for both the BDD and TDD syntax but some aliases exist to make the assertions look good with both styles.

```javascript
var d1 = 'abcdef',
const d1 = 'abcdef',
d2 = 'abc';

d1.should.startWith.d2
expect(d1).to.startsWith(d2)
assert.startsWith(d1, d2)
d1.should.startWith.d2;
expect(d1).to.startsWith(d2);
assert.startsWith(d1, d2);
```

### startsWith/startWith
### startsWith / startWith
```javascript
assert.startsWith('abcdef', 'abc');
expect('abcdef').to.startsWith('abc');
'abcdef'.should.startWith('abc');
```

### startsWithIgnoreCase/startWithIgnoreCase
### startsWithIgnoreCase / startWithIgnoreCase
```javascript
assert.startsWithIgnoreCase('aBcdef', 'abC');
expect('abCdef').to.startsWithIgnoreCase('Abc');
'Abcdef'.should.startWithIgnoreCase('aBc');
```

### endsWith/endWith
### endsWith / endWith
```javascript
assert.endsWith('abcdef', 'def');
expect('abcdef').to.endsWith('def');
'abcdef'.should.endWith('def');
```

### endsWithIgnoreCase/endWithIgnoreCase
### endsWithIgnoreCase / endWithIgnoreCase
```javascript
assert.endsWithIgnoreCase('abcdEf', 'deF');
expect('abcDef').to.endsWithIgnoreCase('dEf');
Expand Down Expand Up @@ -121,7 +121,3 @@ expect('abcabd').to.have.entriesCount('ab', 2);
assert.indexOf('abcabd', 'ab', 0);
expect('abcabd').to.have.indexOf('ab', 0);
```

## Thanks

Thanks to the [chai-datetime](https://github.com/gaslight/chai-datetime) module for giving me an idea for how to structure and test a chai plugin.

0 comments on commit b179d3d

Please sign in to comment.