Detalhes do pacote

@sinonjs/referee-sinon

sinonjs7.8kBSD-3-Clause12.0.0

Sinon.JS assertions for referee

readme (leia-me)

referee-sinon

codecov Contributor Covenant

Sinon.JS and the referee assertion library in one package.

Usage

Install:

npm install @sinonjs/referee-sinon --save-dev

Note that you don't need to install @sinonjs/referee or sinon.

const referee = require("@sinonjs/referee-sinon");

const assert = referee.assert;
const refute = referee.refute;
const sinon = referee.sinon;

Or, if you can make use of destructuring assignments:

const { assert, refute, sinon } = require("@sinonjs/referee-sinon");

Prebuilt global/AMD version

When installing from npm, there is a pre-built global/AMD version in the dist/ folder.

Documentation

https://sinonjs.github.io/referee-sinon/

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

Licence

referee-sinon was released under BSD-3

changelog (log de mudanças)

Changes

12.0.0

  • 1144e38 Use new mochfiy (Maximilian Antoni)
  • 6eca6e5 Drop node 12 and 14, support node 18 and 20 (Maximilian Antoni)
  • 30d712b Update GitHub actions (Maximilian Antoni)
  • b1238cf Upgrade Studio Changes (Maximilian Antoni)
  • 739f1d1 npm audit (Maximilian Antoni)
  • d61fcce Upgrade prettier to v3 and reformat files (Maximilian Antoni)
  • 97e28bf Upgrade husky and lint-staged (Maximilian Antoni)
  • bf9185d Upgrade esbuild (Maximilian Antoni)
  • bb7ee93 Upgrade @sinonjs/eslint-config (Maximilian Antoni)
  • 0ad59c9 Update mocha (Maximilian Antoni)
  • f235626 Update @sinonjs/commons, @sinonjs/referee and sinon to latest (Maximilian Antoni)

Released by Maximilian Antoni on 2023-12-29.

11.0.0

  • 45d4c2b Upgrade referee and sinon (Maximilian Antoni)
  • 636daa8 Support import from es modules (Maximilian Antoni) >

    Without explicitly naming all exports, this fails in es modules: import { assert, refute, match, sinon } from '@sinonjs/referee-sinon';

  • 74cfd6f Fix pre-commit hook (Maximilian Antoni) >

    The npm bin command is not supported anymore.

Released by Maximilian Antoni on 2023-01-24.

10.1.1

  • 81639a0 Prefer @sinonjs/commons@2 (Morgan Roderick) >

    That makes ES2017 support explicit

Released by Morgan Roderick on 2022-11-07.

10.1.0

  • f473c75 Improve messages from calledOnceWith* (Morgan Roderick) >

    Add support for differentianting between when a method has been called an unexpected number of times and when it's been called with unexpected arguments.

    The old message

    [assert.calledOnceWith] Expected [Function (anonymous)] to be called once with arguments 1

    Does not reveal whether the spy was called multiple times or with unexpected arguments

    After this changeset, there are two messages:

    [assert.calledOnceWith] Expected [Function (anonymous)] to be called once, but was called 2 times
    [assert.calledOnceWith] Expected [Function (anonymous)] to be called with arguments 2, but was called with 1

    These messages clearly indicate which of the two combined expectations were unmet

    • calledOnceWith
    • calledOnceWithExactly
    • calledOnceWithMatch

Released by Morgan Roderick on 2021-07-27.

10.0.0

  • b3fff89 Upgrade @sinonjs/referee and sinon (Maximilian Antoni)
  • f10af07 Upgrade mocha and mochify (Maximilian Antoni)
  • 5196049 Update @studio/changes (Maximilian Antoni)
  • 4808b73 Update @sinonjs/eslint-config (Maximilian Antoni)
  • 1aeea11 Update @sinonjs/commons (Maximilian Antoni)
  • 63ccf75 Use npm 7 (Maximilian Antoni)
  • ac52972 Bump ws from 6.2.1 to 6.2.2 (dependabot[bot])
  • 36fb290 Bump browserslist from 4.16.3 to 4.16.6 (dependabot[bot])
  • aff4513 Bump hosted-git-info from 3.0.5 to 3.0.8 (dependabot[bot])
  • 0d59268 Bump lodash from 4.17.20 to 4.17.21 (dependabot[bot])

Released by Maximilian Antoni on 2021-06-08.

9.0.2

  • 37be940 Upgrade @sinonjs/referee to latest (Morgan Roderick)

Released on 2021-04-27.

9.0.1

Released on 2021-04-08.

9.0.0

  • 47e03e1 Use @sinonjs/eslint-config (Morgan Roderick) >

    This drops support for legacy runtimes such as IE11, legacy Edge, Safari 9, etc. Minimum lagnuage support is now ES2017

Released on 2021-03-30.

8.0.1

  • 667058b Add util package (Morgan Roderick) >

    This improves browser support, as it is node internals

Released on 2021-01-07.

8.0.0

  • eba2d3e Upgrade prettier to 2.x (Morgan Roderick) >

    • upgrade eslint-config-prettier
    • upgrade eslint-plugin-prettier
    • run prettier on all JavaScript files
        $(npm bin)/prettier -w -u .

    The MAJOR version bump is because the prettier defaults are incompatible with IE11 and Edge Legacy. Those two browsers are no longer supported.

Released on 2020-11-16.

7.3.0

  • 8b0efed Replace formatio with util inspect (#98) (Maximilian Antoni)

Released by Maximilian Antoni on 2020-10-06.

7.2.0

  • 160b5bf Sinon 9.1 (#96) (Maximilian Antoni) >

    Add calledOnceWithMatch assertion

Released by Maximilian Antoni on 2020-10-01.

7.1.0

  • 91ef947 Fix issues with undefined fakes (Maximilian Antoni) >

    The tests where covering these cases, but the wrong regexp handling in referee exception assertion used to let the tests pass anyway.

    See https://github.com/sinonjs/referee/pull/146

  • f5d9496 Upgrade referee to v6 (Maximilian Antoni)

Released by Maximilian Antoni on 2020-06-17.

7.0.2

  • 54f4e5d Fix sinon assertions with matchers (#83) (Maximilian Antoni) >
    • Add failing test for issue with 2 samsam versions
    • Upgrade referee to v5
    • Reinstall dependencies

Released by Maximilian Antoni on 2020-02-28.

7.0.1

  • 78d7894 Bump @sinonjs/formatio (Morgan Roderick)
  • 1afe7d4 Bump Sinon to latest (Morgan Roderick)

Released on 2020-02-20.

7.0.0

  • 89b3f8d Drop Node 8 support (Morgan Roderick) >

    As can be seen at https://github.com/nodejs/Release, Node 8 reached "end" of life on 2019-12-31, and is no longer actively supported.

    We will stop testing in Node 8 and start testing in Node 13, which will become the next LTS release from April 2020.

Released on 2020-02-19.

6.0.1

Released on 2020-01-06.

6.0.0

  • 1f46f90 Upgrade to Referee 4 and Sinon 8 (Maximilian Antoni)

Released on 2019-12-23.