Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

cucumberOpts incompatible type #3822

Closed
kacpe-r opened this issue Dec 14, 2016 · 7 comments · Fixed by #3919
Closed

cucumberOpts incompatible type #3822

kacpe-r opened this issue Dec 14, 2016 · 7 comments · Fixed by #3919
Assignees
Milestone

Comments

@kacpe-r
Copy link

kacpe-r commented Dec 14, 2016

Hi there,
I'm using protractor 4.0.13, typescript 2.1.4 and cucumber 1.3.1.
In my config.ts I've got such config in cucumberOpts:

cucumberOpts: { require: [ '../steps/**/*Steps.js', '../support/hooks.js' ], format: [ 'pretty', 'json:report.json' ] },

Every time when I run tests I got such error:
config/config.ts(3,12): error TS2322: Type '{ seleniumAddress: string; baseUrl: string; capabilities: { browserName: string; chromeOptions: {...' is not assignable to type 'Config'. Types of property 'cucumberOpts' are incompatible. Type '{ require: string[]; format: string[]; }' is not assignable to type '{ [key: string]: any; require?: string; tags?: string; format?: string; coffee?: any; noSnippets?...'. Types of property 'require' are incompatible. Type 'string[]' is not assignable to type 'string'.

The clue is in config.ts file. In lib/config.ts:563 and lib/config.ts:572 you've got
require?: string;
Could you please change them into:
require?: Array<string>;

Regards,
Kacper

@wswebcreation
Copy link
Contributor

wswebcreation commented Dec 14, 2016

@kacpe-r,

See #3817. I think it will solve your problem, if so the issue can be closed ;-)

@kacpe-r
Copy link
Author

kacpe-r commented Dec 14, 2016

@wswebcreation So far it fixes only 'require'. I've been writing about 'require' and 'format'.

@wswebcreation
Copy link
Contributor

Ok, clear, missed that, sorry

cnishina pushed a commit that referenced this issue Dec 14, 2016
…ngs (#3817)

- Both cucumber options require and format now support `string` or `string[]` see #3822 #3817
- Remove no longer available options and fix `dryRun` type
- Update comment for `dryRun`
@juliemr
Copy link
Member

juliemr commented Dec 19, 2016

Should we have cucumberOpts in the config at all? Can we allow arbitrary other properties on the config instead?

@cnishina
Copy link
Member

I don't think this hurts as long as it is kept up to date. We also recently merged a docs for cucumber: #3674. Probably we should make the config more flexible with something like:

export interface Config {
  [key: string]: any;

@cnishina
Copy link
Member

Also, at least this issue has been fixed with: https://github.com/angular/protractor/blob/master/lib/config.ts#L558

Leaving it open to discuss the above comment.

@cnishina
Copy link
Member

cnishina commented Jan 4, 2017

Per discussion offline with Julie:

  • should leave the documentation for Cucumber
  • should remove the cucumber options in the Config and add the [key:string]: any;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants