All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- properties for promise and observable dependency properties in the autoSpy call e.g. autoSpy(MyService, {obs$: myServiceObs$, promProp: myServicePromProp})
- the promise can be rejected or resolved
- the observable can emit, error or complete
- observable dependency methods now auto return an EMPTY to avoid the
.pipe is not a method on undefined
andyou've passed undefined where an Observable was expected
errors - promise dependency methods now auto return a new Promise() (that never resolves/rejects) to avoid the
.then is not a method on undefined
error - adds property stubs (ReplaySubject and a Promise with captures resolve and reject functions)
- adds methods for resolve/reject the promise props
- adds methods for emit/error/complete the promise and observable property stubs
- adds methods for returning a value for each spy that's called
- updates and adds only the needed things (methods, spies and spy-manipulation methods)
- adds missing imports from rxjs or autoSpy
- auto-detects jasmine or jest and allows for cli or options flag for the same
- fixed error when trying to overwrite existing specs and using
--force
flag - fixed behavior when custom template has no custom functions - just use standard update when
scuri:spec --update
or throw if user specifiedscuri:update-custom
- only detect jest/jasmine via the root folder (don't use tree.visit as that reads ALL files and takes a lot of time)
- configuration for autoSpy location
- add default values for promise and observable returning method spies #148
- add support for strict TS for autospy
- add e2e testing using verdaccio (local npm registry), verifying new version of npm actually installs and runs the create and update on changes
- use custom template when updating spec for a class. Use // scuri:mark and /*scuri:template:mark:<%my template%>/ to mark the location and the template for the update. Multiple marks and templates supported. See custom template guide
- Add option for user to specify their own template for a file with function (1.1.0-rc.1) (--functionTemplate or functionTemplate in config)
- Add configuration by file(1.0.8-rc.2) (configure classTemplate)
- Add option for user to specify their own template(1.0.8-rc.1) (--classTemplate)
- Updated npm package versions(1.0.8-rc.2)
- Allow
--name
to be skipped - infers first arg as file name
- Update the Readme
- Issue 108 - use the class shorthand when updating a spec
- Issue 94 - add a single test case when creating the spec for a class without public methods
- Issue 95 - add a test case for a file with at least one exported function
- Make the shorthand dynamic based on the type of tested entity - 'c' for component, 's' for service, etc.
- Issue 100 - only add missing test cases based on method invocations, rather than test case title
- Typos and syntax errors in readme and test cases
- Moved the contributing guide out to its own file
- Issue 93 - line endings in the template switched to LF to support all platforms
- Issue 92 - export SpyOf by default
- Wiki link from README.md
- README.md links
- Actually publish the @latest instead of @next
- Correct indentation of added dependencies (following the last symbol just above) Issue 3
- Correct indentation of added methods (following the last symbol just above) Issue 3
- Correct imports: only import missing modules and do not double existing imports Issue 3
- Fix auto-spy not working with Typescript target e2015. The issue comes from methods of classes NOT being enumerable i.e. Object.keys(obj) will not "see" them
- Allow the update to take the name of the spec (
--update c.spec.ts
will now work instead of throwing)
- Update the Readme roadmap
- Finish issue #40 - update on spec created by the ng CLI - add missing providers by using the setup function
- Start on issue #40 - update on spec with missing
setup
function should create it. Plus fixed a small issue whereupdate
would add a comma when no new constructor params are added.
- issue #34 - update should be able to handle nested setup function
- issue #30 - autospy schematic accepts
path
to tell it where to place the created file
- Fix the missing autospy files
- Release with only doc changes - no other changes. Required to update the doc on https://www.npmjs.com/package/scuri site.
- Release with only doc changes - no other changes. Required to update the doc on https://www.npmjs.com/package/scuri site.
- AutoSpy create schematic. Support for jasmine and jest. As well as ts 2.8 and previous(legacy). To use:
schematics scuri:autospy
- for angular 5 and previousng g scuri:autospy
for angular 6 and up Both cases requiresnpm i scuri
(ornpm i -g scuri
) and the first requiresnpm i -g @angular-devkit/schematics-cli
.
- Import dependencies when including them in the spec-s. Both for Create and Update
- Import dependencies when including them in the spec-s. Both for Create and Update
- Actually have all required deps and build the js...
- Make all unneeded dependencies devDependencies to avoid clashing and breaking users. All we need is the devkit core and the rest is dev-time dependency only
- Support for updating the spec to add tests for newly added methods in a class. Case - add one more method to the class - run scuri update (via scuri-code or the command line)
- Change behavior to rely on flags to decide if we should update. If
--update
is passed in we always try to update. If not we always try to create a new spec file. From there on the schematics cli will make the decision (based on--force
) to overwrite or not.
- Fix bug where the generated file was not getting moved next to the class-under-test file.
We can't support ng5 because using the
move
rule is not compatible with the legacy wat of returning the result vs returning a function (Rule) that the cli (ng cli or schematics) should deal with
- Support updating SCuri generated spec files (ones with a function setup() and a builder in it)
- Have the generated
it
method call the class-under-test public method
- Update docs for easy start and contributor guide.
- Support
async
type of public method. Excludeprivate
andprotected
.
- Rule executes and returns so Angular 5 will work with it
- Make the first argument be the
--name
by default
- Add files. Can't generate spec w/o them.
- Initial release
- Reads angular component and creates a spec for it with a setup builder method and an it spec for each public method. Uses the autoSpy by default. Uses the AAA arrange act assert convention.