Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

includeWipPactsSince cant be undefined #939

Closed
4 of 5 tasks
dimkin-eu opened this issue Aug 30, 2022 · 5 comments
Closed
4 of 5 tasks

includeWipPactsSince cant be undefined #939

dimkin-eu opened this issue Aug 30, 2022 · 5 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@dimkin-eu
Copy link

Software versions

Please provide at least OS and version of pact-js

  • Node Version: 16

Issue Checklist

Please confirm the following:

  • I have upgraded to the latest
  • I have the read the FAQs in the Readme
  • I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

Expected behaviour

this must work

includeWipPactsSince: isCI ? new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split("T")[0] : undefined,

Actual behaviour

TypeError: includeWipPactsSince

Steps to reproduce

I've just ( tried to ) upgrade from 9.17.3 to 10.1.2 and having TypeError: includeWipPactsSince

Reporting this issue per @mefellows request from slack

@dimkin-eu dimkin-eu added the bug Indicates an unexpected problem or unintended behavior label Aug 30, 2022
@TimothyJones
Copy link
Contributor

Why do you expect that to work? What would includeWipPactsSince: undefined mean?

I don't think this is a bug.

@TimothyJones
Copy link
Contributor

TimothyJones commented Aug 30, 2022

If you want a way to only specify includeWipPactsSince based on a variable, this is more idiomatic:

...(isCI ? { 
       includeWipPactsSince: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split("T")[0] 
    } : {})

@dimkin-eu
Copy link
Author

dimkin-eu commented Aug 31, 2022

undefined worked perfectly before upgrade
types.d.ts asks for string includeWipPactsSince?: string;

@TimothyJones
Copy link
Contributor

includeWipPactsSince?: string;

What about this makes you think it can be undefined? This says you may have includeWipPactsSince, and if you do, it must be a string.

This has not changed since 9.x - see the old definition here.

See the discussion in slack for more information. I suspect the break is actually in your typescript options.

@mefellows
Copy link
Member

Closing as won't fix.

@mefellows mefellows closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants