Comments (4)
I commented the lines with error on spec above and run the tests. I receive this message:
Error: src/auto-spy.ts(14,36): error TS1005: ';' expected.
src/auto-spy.ts(14,89): error TS1128: Declaration or statement expected.
src/auto-spy.ts(14,90): error TS1109: Expression expected.
src/auto-spy.ts(14,91): error TS1109: Expression expected.
The line with error is:
type SpyOf<T> = T &
Partial<{ [k in keyof T]: T[k] extends (...args: any[]) => any ? jasmine.Spy : T[k] }>;
I am using Angular 5, typescript 2.6.0, jasmine 3.4.0
from scuri.
It looks like 2 issues described here. Let me start by the second:
- Seems that you need to use the
--legacy
flag, see AutoSpy point. In short:
- ng g scuri:autospy --for jest --legacy would generate a ts<2.8 jest compatible autoSpy type and function ng g scuri:autospy would generate a ts>2.8 jasmine compatible autoSpy type and function
- replace the existing autospy.ts with this one, supporting older ts version
- Seems, you expect SCuri to place parameter(s) in the methods that need parameters. Correct me if I am wrong, please.
it('when getDocumentoPlaceHolder is called it should', () => {
// arrange
const { build } = setup().default();
const c = build();
// act
c.getDocumentoPlaceHolder(/* SCuri, add parameer here */);
// assert
// expect(c).toEqual
});
How would that look like? And why would SCuri try to do that?
SCuri's purpose is to help with boilerplate, not actually finish the logic of the unit test.
What do you think?
from scuri.
@gandadil what do you think about my suggestion above?
from scuri.
@gandadil Closing this...
from scuri.
Related Issues (20)
- Overwrite when using force HOT 1
- Handle a class and a function being exported from the same file
- Can't call functions defined in template from scuri:template:* HOT 2
- Call next schematic
- classTemplate doesn't work as expected in release 1.2.0 HOT 4
- Delete the whole expression when removing dependencies HOT 1
- Add default Observable (EMPTY) and default Promise (new Promise()) values for dependency method spy return values.
- Lint on commit
- Handle properties with Promise or Observable HOT 1
- Handle update with a custom template without any custom functions
- Check for import of autoSpy when using --update on previously created spec file HOT 3
- Support inject function from angular
- Ensure jest specific mock returns are used
- Handle Arrays of deps
- Fix autoSpy import being added in the middle of other imports
- Fix adding multiple new lines when creating deps in setup method
- Combine TS Host with Tree
- Use FileVisitorCancelToken to stop after detected one or the other HOT 1
- Handle functions declared as const
- Allow for turning off the Typescript compilation dependent features as they take 5x or 10x more time
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scuri.