chai-inline-snapshot

0.0.2 • Public • Published

chai-inline-snapshot

  • [x] inline snapshot
  • [x] indent free
  • [ ] auto insert
npm install --dev chai
npm install --dev chai-inline-snapshot
import 'chai-inline-snapshot'
import { expect } from 'chai'

export let test = () => {
  let actual = [
    {
      text: 'https://mp.weixin.qq.com/s/jLMBp1e7BC-PGr2tLEQpRQ\n周日读报',
      type: 'text'
    },
    {
      index: 21,
      type: 'qqface'
    }
  ]
  expect(actual).to.matchInlineSnapshot(`
    [
      {
        "text": "https://mp.weixin.qq.com/s/jLMBp1e7BC-PGr2tLEQpRQ
    周日读报",
        "type": "text",
      },
      {
        "index": 21,
        "type": "qqface",
      },
    ]
  `)
}
ζ npm run coverage
> c8 xv

index.test.js
indent.test.js
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |     100 |      100 |     100 |     100 |
 index.js |     100 |      100 |     100 |     100 |
----------|---------|----------|---------|---------|-------------------

Readme

Keywords

none

Package Sidebar

Install

npm i chai-inline-snapshot

Weekly Downloads

2

Version

0.0.2

License

ISC

Unpacked Size

3.55 kB

Total Files

4

Last publish

Collaborators

  • fritx