New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jasmine-auto-spies

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-auto-spies - npm Package Compare versions

Comparing version 5.4.0 to 6.0.0

.eslintignore

3

commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional']
extends: ['@commitlint/config-conventional'],
ignores: [(message) => message.includes('WIP')],
};
{
"name": "jasmine-auto-spies",
"version": "5.4.0",
"version": "6.0.0",
"repository": {

@@ -9,16 +9,17 @@ "type": "git",

"description": "Create automatic spies from classes in jasmine tests, also for promises and observables",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rimraf src/**/*.js* src/**/*.d.ts *.d.ts",
"clean": "rimraf dist",
"commit": "git-cz",
"build": "tsc",
"compile": "tsc -p tsconfig.build.json",
"build": "run-s clean compile",
"test": "karma start",
"test:watch": "karma start --auto-watch --no-single-run",
"test:full": "yarn run lint&& yarn run test",
"test:full": "run-s lint test",
"format:fix": "pretty-quick --staged",
"lint": "tslint -p .",
"lint": "eslint . --ext .js,.ts",
"lint:fix": "eslint . --ext .js,.ts --fix",
"lint:commitmsg": "commitlint -E HUSKY_GIT_PARAMS",
"prepublishOnly": "yarn run build",
"postpublish": "yarn run clean",
"travis-deploy-once": "travis-deploy-once",

@@ -52,42 +53,44 @@ "semantic-release": "semantic-release"

"devDependencies": {
"@commitlint/cli": "7.0.0",
"@commitlint/config-conventional": "7.0.1",
"@commitlint/cli": "9.1.2",
"@commitlint/config-conventional": "9.1.2",
"@hirez_io/jasmine-given": "1.0.4",
"@types/deep-equal": "1.0.1",
"@types/jasmine": "^2.5.53",
"@types/jasmine-given": "^2.6.0",
"@types/tapable": "0.2.5",
"@types/webpack": "4.4.11",
"awesome-typescript-loader": "^3.1.3",
"commitizen": "3.1.2",
"cz-conventional-changelog": "2.1.0",
"husky": "2.0.0",
"@types/jasmine": "^3.5.14",
"@types/tapable": "1.0.6",
"@types/webpack": "4.41.21",
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"awesome-typescript-loader": "^5.2.1",
"commitizen": "4.2.0",
"cz-conventional-changelog": "3.2.1",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"husky": "4.2.5",
"istanbul-instrumenter-loader": "3.0.1",
"jasmine": "3.5.0",
"jasmine-given": "^2.6.4",
"karma": "^1.7.0",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.1",
"karma-jasmine": "1.1.0",
"karma-jasmine-diff-reporter": "1.2.0",
"karma-jasmine-given": "0.1.1",
"jasmine-core": "3.6.0",
"karma": "^5.1.1",
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-jasmine": "4.0.1",
"karma-jasmine-diff-reporter": "2.0.0",
"karma-mocha-reporter": "2.2.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^3.0.4",
"karma-webpack": "^2.0.3",
"prettier": "1.14.2",
"pretty-quick": "1.6.0",
"rimraf": "2.6.1",
"karma-sourcemap-loader": "^0.3.8",
"karma-typescript": "^5.1.0",
"karma-webpack": "^4.0.2",
"npm-run-all": "4.1.5",
"prettier": "2.1.0",
"pretty-quick": "3.0.0",
"rimraf": "3.0.2",
"rxjs": "^6.0.0",
"semantic-release": "^15.6.0",
"semantic-release": "^17.1.1",
"travis-deploy-once": "^5.0.0",
"ts-node": "^3.0.6",
"tslint": "5.18.0",
"typescript": "^3.5.3",
"webpack": "2.7.0"
"webpack": "4.44.1"
},
"dependencies": {
"deep-equal": "1.0.1"
"deep-equal": "2.0.3"
},
"peerDependencies": {
"jasmine": ">=2.6.0 <=3.5.0",
"jasmine-core": ">=2.6.0 <=3.6.0",
"rxjs": "^6.0.0",

@@ -94,0 +97,0 @@ "typescript": ">=2.8.1"

@@ -47,3 +47,3 @@ # jasmine-auto-spies

✅ **Keep you tests DRY** - no more repeated spy setup code, no need for separate spy files
✅ **Keep your tests DRY** - no more repeated spy setup code, no need for separate spy files

@@ -254,55 +254,1 @@ ✅ **Type completion** for both the original Class and the spy methods

```
---
## ObserverSpy 👀💪
#### `new ObserverSpy()`
In order to test more complicated observables,
you can use an `ObserverSpy` instance to "record" all the messages a source observable emits and get them as an array.
You can also spy on the `error` or `complete` states of the observer.
**Usage:**
```js
it('should spy on Observable values', () => {
const observerSpy = new ObserverSpy();
const fakeValues = ['first', 'second', 'third'];
const fakeObservable = of(...fakeValues);
const subscription = fakeObservable.subscribe(observerSpy);
// DO SOME LOGIC HERE
// unsubscribing is optional, it's good for stopping intervals etc
subscription.unsubscribe();
expect(observerSpy.receivedNext()).toBe(true);
expect(observerSpy.getValues()).toEqual(fakeValues);
expect(observerSpy.getValuesLength()).toEqual(3);
expect(observerSpy.getFirstValue()).toEqual('first');
expect(observerSpy.getValueAt(1)).toEqual('second');
expect(observerSpy.getLastValue()).toEqual('third');
expect(observerSpy.receivedComplete()).toBe(true);
});
it('should spy on Observable errors', () => {
const observerSpy = new ObserverSpy();
const fakeObservable = throwError('FAKE ERROR');
fakeObservable.subscribe(observerSpy);
expect(observerSpy.receivedError()).toBe(true);
expect(observerSpy.getError()).toEqual('FAKE ERROR');
});
```

@@ -12,7 +12,9 @@ {

"downlevelIteration": true,
"lib": ["es2015", "es2016"],
"lib": ["es2015", "es2016", "DOM"],
"pretty": true,
"strict": true
"strict": true,
"typeRoots": ["node_modules/types", "node_modules"],
"types": ["@hirez_io/jasmine-given"]
},
"include": ["src"]
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc