@supertape/operator-stub 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,9 @@
1
- # @supertape/operator-stub [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # @supertape/operator-stub [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
3
  [NPMIMGURL]: https://img.shields.io/npm/v/supertape.svg?style=flat&longCache=true
4
4
  [BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/supertape/master.svg?style=flat&longCache=true
5
- [DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/supertape.svg?path=packages/operator-stub&style=flat&longCache=true
6
5
  [NPMURL]: https://npmjs.org/package/supertape "npm"
7
6
  [BuildStatusURL]: https://travis-ci.org/coderaiser/supertape "Build Status"
8
- [DependencyStatusURL]: https://david-dm.org/coderaiser/supertape?path=packages/operator-stub "Dependency Status"
9
7
  [CoverageURL]: https://coveralls.io/github/coderaiser/supertape?branch=master
10
8
  [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/supertape/badge.svg?branch=master&service=github
11
9
 
package/lib/stub.d.ts CHANGED
@@ -2,10 +2,10 @@ import {Stub} from '@cloudcmd/stub';
2
2
 
3
3
  type Result = {
4
4
  is: boolean,
5
- expected: any,
6
- actual: any,
5
+ expected: unknown,
6
+ actual: unknown,
7
7
  message: string,
8
- }
8
+ };
9
9
  export function stub(arg?: unknown): Stub;
10
10
 
11
11
  export interface OperatorStub {
package/lib/stub.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {isStub} from '@cloudcmd/stub';
2
2
 
3
3
  const isString = (a) => typeof a === 'string';
4
- const getExpectedStubMessage = (fn) => `Expected stub, but received: ${fn.toString()}`;
4
+ const getExpectedStubMessage = (fn) => `Expected stub, but received: ${fn?.toString()}`;
5
5
 
6
6
  const {stringify} = JSON;
7
7
  const {isArray} = Array;
@@ -65,13 +65,9 @@ export const calledCount = (operator) => (fn, count, message = 'should be called
65
65
  return operator.equal(fn.callCount, count, message);
66
66
  };
67
67
 
68
- export const calledOnce = (operator) => (fn, message = 'should be called once') => {
69
- return calledCount(operator)(fn, 1, message);
70
- };
68
+ export const calledOnce = (operator) => (fn, message = 'should be called once') => calledCount(operator)(fn, 1, message);
71
69
 
72
- export const calledTwice = (operator) => (fn, count, message = 'should be called twice') => {
73
- return calledCount(operator)(fn, 2, message);
74
- };
70
+ export const calledTwice = (operator) => (fn, count, message = 'should be called twice') => calledCount(operator)(fn, 2, message);
75
71
 
76
72
  export const calledWithNew = (operator) => (fn, message = 'should be called with new') => {
77
73
  if (!isStub(fn))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supertape/operator-stub",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "supertape stub operator",
6
6
  "homepage": "http://github.com/coderaiser/supertape",
@@ -39,15 +39,16 @@
39
39
  "devDependencies": {
40
40
  "@babel/core": "^7.12.9",
41
41
  "c8": "^7.3.5",
42
- "check-dts": "^0.5.5",
42
+ "check-dts": "^0.6.5",
43
43
  "eslint": "^8.0.0-beta.0",
44
44
  "eslint-plugin-node": "^11.1.0",
45
- "eslint-plugin-putout": "^10.0.1",
45
+ "eslint-plugin-putout": "^13.0.1",
46
46
  "madrun": "^8.0.0",
47
47
  "mock-require": "^3.0.2",
48
48
  "nodemon": "^2.0.2",
49
- "putout": "^20.0.1",
50
- "supertape": "^6.0.1"
49
+ "putout": "^24.1.0",
50
+ "supertape": "^6.0.1",
51
+ "typescript": "^4.4.4"
51
52
  },
52
53
  "license": "MIT",
53
54
  "engines": {