function createTestCase(key, value, type) {
    it(`should ${
      type === "success" ? "successfully validate" : "throw an error on"
    } the "${key}" option with "${stringifyValue(value)}" value`, (done) => {
      const compiler = getCompiler();

      let webpackDevMiddleware;
      let error;

      try {
        webpackDevMiddleware = middleware(compiler, { [key]: value });
      } catch (err) {
        if (err.name !== "ValidationError") {
          throw err;
        }

        error = err;
      } finally {
        if (type === "success") {
          expect(error).toBeUndefined();
        } else if (type === "failure") {
          expect(() => {
            throw error;
          }).toThrowErrorMatchingSnapshot();
        }

        if (webpackDevMiddleware) {
          webpackDevMiddleware.waitUntilValid(() => {
            webpackDevMiddleware.close(() => {
              done();
            });
          });
        } else {
          done();
        }
      }
    });
  }
@param {string} key key
@param {any} value value
@param {"success" | "failure"} type type