Skip to content

Throw if recorder writes to fixture twice #6

Open

Description

@ericclemmons

If a fixture is being recorded twice with different payloads, then that's a sign that there's a bug in the recorder or program:

  • Requesting /me with a cookie, but not setting username gets recorded as "all".
  • Requesting /me without a cookie, expecting a 403, but gets the previous user's data.

Activity

  1. ericclemmons commented on Apr 19, 2019

    @ericclemmons
    OwnerAuthor

    This is easily reproducible with current tests via Jest:

    1. jest --watch
    2. Toggle to RERECORD
    3. The tests re-run.

    As a solution, I think that the JestRecorderWatchPlugin should revert back to REPLAY after re-recording.

  2. ericclemmons commented on Apr 19, 2019

    @ericclemmons
    OwnerAuthor
    const fetch = require("node-fetch");
    
    describe("time", () => {
      it("should stand still", async () => {
        const res = await fetch("http://worldclockapi.com/api/json/pst/now");
    
        expect(await res.json()).toMatchInlineSnapshot();
      });
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions