UNPKG

4.48 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const ava_1 = require("ava");
4const uuid_1 = require("uuid");
5const index_1 = require("../index");
6const util_1 = require("./fixtures/util");
7const util_aws_1 = require("./fixtures/util-aws");
8const funcs = require("./fixtures/functions");
9ava_1.default("remote aws cleanup removes ephemeral resources", async (t) => {
10 const func = await index_1.faastAws(funcs, {
11 mode: "queue",
12 gc: "off",
13 description: t.title
14 });
15 await func.cleanup({ deleteCaches: true });
16 await util_1.checkResourcesCleanedUp(t, await util_aws_1.getAWSResources(func));
17});
18ava_1.default("remote aws cleanup removes lambda layers", async (t) => {
19 const func = await index_1.faastAws(funcs, {
20 packageJson: {
21 name: uuid_1.v4(),
22 version: "0.0.2",
23 description: "aws cleanup layer test",
24 repository: "foo",
25 license: "ISC",
26 dependencies: {
27 "chrome-aws-lambda": "latest",
28 "puppeteer-core": "latest"
29 }
30 },
31 gc: "off",
32 description: t.title
33 });
34 await func.cleanup({ deleteCaches: true });
35 await util_1.checkResourcesCleanedUp(t, await util_aws_1.getAWSResources(func));
36});
37//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXdzLWNsZWFudXAudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3Rlc3QvYXdzLWNsZWFudXAudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZCQUF1QjtBQUN2QiwrQkFBa0M7QUFDbEMsb0NBQW9DO0FBQ3BDLDBDQUEwRDtBQUMxRCxrREFBc0Q7QUFDdEQsOENBQThDO0FBRTlDLGFBQUksQ0FBQyxnREFBZ0QsRUFBRSxLQUFLLEVBQUMsQ0FBQyxFQUFDLEVBQUU7SUFDN0QsTUFBTSxJQUFJLEdBQUcsTUFBTSxnQkFBUSxDQUFDLEtBQUssRUFBRTtRQUMvQixJQUFJLEVBQUUsT0FBTztRQUNiLEVB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