Skip to content

test(integration): update title and catch all outputs#2951

Merged
lydell merged 1 commit intoprettier:masterfrom
ikatyang:test/integration-update
Oct 2, 2017
Merged

test(integration): update title and catch all outputs#2951
lydell merged 1 commit intoprettier:masterfrom
ikatyang:test/integration-update

Conversation

@ikatyang
Copy link
Copy Markdown
Member

@ikatyang ikatyang commented Oct 2, 2017

Context: #2767 (comment)

Add title (stdout), (stderr), etc. and make sure there's no unexpected outputs at all.

before:

const result = runPrettier(...);
expect(result.stdout).toMatchSnapshot();
expect(result.status).toEqual(0);

after

runPrettier(...).test({ status: 0 }); /*=>
  const result = runPrettier(...);
  test("(stdout)", () => {
    expect(result.stdout).toMatchSnapshot();
  });
  test("(stderr)", () => {
    expect(result.stderr).toMatchSnapshot();
  });
  test("(write)", () => {
    expect(result.write).toMatchSnapshot();
  });
  test("(status)", () => {
    expect(result.status).toEqual(0);
  });
*/

`;

exports[`negated options work 2`] = `""`;
exports[`deprecated options are warned (write) 1`] = `Array []`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these arrays?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this:

Array [
  Object {	
    "content": "var x = 1;",
    "filename": "unformated.js",
  },
]

Copy link
Copy Markdown
Member

@lydell lydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@lydell lydell merged commit 7770356 into prettier:master Oct 2, 2017
@ikatyang ikatyang deleted the test/integration-update branch October 2, 2017 16:09
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 19, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants