webpack-subresource-integrity
Version:
Webpack plugin for enabling Subresource Integrity
28 lines • 1.47 kB
JavaScript
/**
* Copyright (c) 2015-present, Waysact Pty Ltd
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const __1 = require("..");
const test_utils_1 = require("./test-utils");
jest.mock("html-webpack-plugin");
test("error when loading html-webpack-plugin", () => __awaiter(void 0, void 0, void 0, function* () {
yield expect((0, test_utils_1.runWebpack)({
entry: (0, path_1.resolve)(__dirname, "./__fixtures__/simple-project/src/"),
plugins: [new __1.SubresourceIntegrityPlugin()],
})).rejects.toThrow("bogus hwp accessed");
}));
//# sourceMappingURL=hwp-error.test.js.map
;