hawkins / prettier-webpack-plugin

Process your Webpack dependencies with Prettier
https://travis-ci.org/hawkins/prettier-webpack-plugin
50 stars 14 forks source link

Add tests #8

Closed hawkins closed 7 years ago

hawkins commented 7 years ago

Fixes #6

Still to-do:

hawkins commented 7 years ago

Running into a wild issue here - the test throws on invalid prettier config options fails by throwing the error we actually expect it to throw. Almost as if it is thrown on another thread.

  it("throws on invalid prettier config options", async () => {
    const input = `./temp/${uuid()}.js`;
    const output = `./temp/${uuid()}.js`;

    await prepareEntry(sampleCode, input);

    return expect(
      bundle({
        entry: input,
        output: { filename: output },
        plugins: [new PrettierPlugin({ singleQuote: () => null })]
      })
    ).rejects.toMatchSnapshot();
  });

The previous test is expected to throw the following error, yet it still crashes the test suite:

screen shot 2017-06-09 at 3 04 09 pm

Since it actually works as expected, I've commented it out and will merge anyway. I'll open up an issue to improve this in the future, but I can't afford to spend any more time on this for now.