@pulumi/pulumi 3.46.1 → 3.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/automation/remoteWorkspace.js +5 -5
- package/automation/remoteWorkspace.js.map +1 -1
- package/automation/stack.js +3 -3
- package/automation/stack.js.map +1 -1
- package/package.json +1 -1
- package/proto/language_grpc_pb.js +34 -0
- package/proto/language_pb.js +629 -0
- package/runtime/resource.js +1 -0
- package/runtime/resource.js.map +1 -1
- package/tests/automation/cmd.spec.js +2 -3
- package/tests/automation/cmd.spec.js.map +1 -1
- package/tests/automation/localWorkspace.spec.js +68 -78
- package/tests/automation/localWorkspace.spec.js.map +1 -1
- package/tests/automation/remoteWorkspace.spec.js +181 -0
- package/tests/automation/remoteWorkspace.spec.js.map +1 -1
- package/tests/automation/util.d.ts +1 -0
- package/tests/automation/util.js +30 -0
- package/tests/automation/util.js.map +1 -0
- package/tests/iterable.spec.js +4 -5
- package/tests/iterable.spec.js.map +1 -1
- package/tests/options.spec.js +40 -41
- package/tests/options.spec.js.map +1 -1
- package/tests/output.spec.js +152 -153
- package/tests/output.spec.js.map +1 -1
- package/tests/provider.spec.js +4 -5
- package/tests/provider.spec.js.map +1 -1
- package/tests/resource.spec.js +8 -9
- package/tests/resource.spec.js.map +1 -1
- package/tests/runtime/asyncIterableUtil.spec.js +10 -11
- package/tests/runtime/asyncIterableUtil.spec.js.map +1 -1
- package/tests/runtime/langhost/run.spec.js +2 -3
- package/tests/runtime/langhost/run.spec.js.map +1 -1
- package/tests/runtime/props.spec.js +14 -15
- package/tests/runtime/props.spec.js.map +1 -1
- package/tests/runtime/tsClosureCases.js +13 -12
- package/tests/runtime/tsClosureCases.js.map +1 -1
- package/tests/unwrap.spec.js +18 -19
- package/tests/unwrap.spec.js.map +1 -1
- package/tests/util.js +9 -3
- package/tests/util.js.map +1 -1
- package/version.js +1 -1
package/tests/output.spec.js
CHANGED
|
@@ -33,7 +33,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
const assert = __importStar(require("assert"));
|
|
34
34
|
const output_1 = require("../output");
|
|
35
35
|
const runtime = __importStar(require("../runtime"));
|
|
36
|
-
const util_1 = require("./util");
|
|
37
36
|
// This ensures that the optionality of 'x' and 'y' are preserved when describing an Output<Widget>.
|
|
38
37
|
// Subtle changes in the definitions of Lifted<T> can make TS think these are required, which can
|
|
39
38
|
// break downstream consumers.
|
|
@@ -67,7 +66,7 @@ function mockOutput(isKnown, value) {
|
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
68
|
describe("output", () => {
|
|
70
|
-
it("propagates true isKnown bit from inner Output",
|
|
69
|
+
it("propagates true isKnown bit from inner Output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
70
|
runtime._setIsDryRun(true);
|
|
72
71
|
const output1 = new output_1.Output(new Set(), Promise.resolve("outer"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
73
72
|
const output2 = output1.apply(v => new output_1.Output(new Set(), Promise.resolve("inner"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set())));
|
|
@@ -75,8 +74,8 @@ describe("output", () => {
|
|
|
75
74
|
assert.strictEqual(isKnown, true);
|
|
76
75
|
const value = yield output2.promise();
|
|
77
76
|
assert.strictEqual(value, "inner");
|
|
78
|
-
}))
|
|
79
|
-
it("propagates false isKnown bit from inner Output",
|
|
77
|
+
}));
|
|
78
|
+
it("propagates false isKnown bit from inner Output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
79
|
runtime._setIsDryRun(true);
|
|
81
80
|
const output1 = new output_1.Output(new Set(), Promise.resolve("outer"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
82
81
|
const output2 = output1.apply(v => new output_1.Output(new Set(), Promise.resolve("inner"), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set())));
|
|
@@ -84,8 +83,8 @@ describe("output", () => {
|
|
|
84
83
|
assert.strictEqual(isKnown, false);
|
|
85
84
|
const value = yield output2.promise();
|
|
86
85
|
assert.strictEqual(value, "inner");
|
|
87
|
-
}))
|
|
88
|
-
it("can not await if isKnown is a rejected promise.",
|
|
86
|
+
}));
|
|
87
|
+
it("can not await if isKnown is a rejected promise.", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
88
|
runtime._setIsDryRun(true);
|
|
90
89
|
const output1 = new output_1.Output(new Set(), Promise.resolve("outer"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
91
90
|
const output2 = output1.apply(v => new output_1.Output(new Set(), Promise.resolve("inner"), Promise.reject(new Error("foo")), Promise.resolve(false), Promise.resolve(new Set())));
|
|
@@ -101,8 +100,8 @@ describe("output", () => {
|
|
|
101
100
|
}
|
|
102
101
|
catch (err) {
|
|
103
102
|
}
|
|
104
|
-
}))
|
|
105
|
-
it("propagates true isSecret bit from inner Output",
|
|
103
|
+
}));
|
|
104
|
+
it("propagates true isSecret bit from inner Output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
105
|
runtime._setIsDryRun(true);
|
|
107
106
|
const output1 = new output_1.Output(new Set(), Promise.resolve("outer"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
108
107
|
const output2 = output1.apply(v => new output_1.Output(new Set(), Promise.resolve("inner"), Promise.resolve(true), Promise.resolve(true), Promise.resolve(new Set())));
|
|
@@ -110,8 +109,8 @@ describe("output", () => {
|
|
|
110
109
|
assert.strictEqual(isSecret, true);
|
|
111
110
|
const value = yield output2.promise();
|
|
112
111
|
assert.strictEqual(value, "inner");
|
|
113
|
-
}))
|
|
114
|
-
it("retains true isSecret bit from outer Output",
|
|
112
|
+
}));
|
|
113
|
+
it("retains true isSecret bit from outer Output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
115
114
|
runtime._setIsDryRun(true);
|
|
116
115
|
const output1 = new output_1.Output(new Set(), Promise.resolve("outer"), Promise.resolve(true), Promise.resolve(true), Promise.resolve(new Set()));
|
|
117
116
|
const output2 = output1.apply(v => new output_1.Output(new Set(), Promise.resolve("inner"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set())));
|
|
@@ -119,315 +118,315 @@ describe("output", () => {
|
|
|
119
118
|
assert.strictEqual(isSecret, true);
|
|
120
119
|
const value = yield output2.promise();
|
|
121
120
|
assert.strictEqual(value, "inner");
|
|
122
|
-
}))
|
|
121
|
+
}));
|
|
123
122
|
describe("apply", () => {
|
|
124
123
|
function createOutput(val, isKnown, isSecret = false) {
|
|
125
124
|
return new output_1.Output(new Set(), Promise.resolve(val), Promise.resolve(isKnown), Promise.resolve(isSecret), Promise.resolve(new Set()));
|
|
126
125
|
}
|
|
127
|
-
it("can run on known value during preview",
|
|
126
|
+
it("can run on known value during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
128
127
|
runtime._setIsDryRun(true);
|
|
129
128
|
const out = createOutput(0, true);
|
|
130
129
|
const r = out.apply(v => v + 1);
|
|
131
130
|
assert.strictEqual(yield r.isKnown, true);
|
|
132
131
|
assert.strictEqual(yield r.promise(), 1);
|
|
133
|
-
}))
|
|
134
|
-
it("can run on known awaitable value during preview",
|
|
132
|
+
}));
|
|
133
|
+
it("can run on known awaitable value during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
135
134
|
runtime._setIsDryRun(true);
|
|
136
135
|
const out = createOutput(0, true);
|
|
137
136
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
138
137
|
assert.strictEqual(yield r.isKnown, true);
|
|
139
138
|
assert.strictEqual(yield r.promise(), "inner");
|
|
140
|
-
}))
|
|
141
|
-
it("can run on known known output value during preview",
|
|
139
|
+
}));
|
|
140
|
+
it("can run on known known output value during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
142
141
|
runtime._setIsDryRun(true);
|
|
143
142
|
const out = createOutput(0, true);
|
|
144
143
|
const r = out.apply(v => createOutput("inner", true));
|
|
145
144
|
assert.strictEqual(yield r.isKnown, true);
|
|
146
145
|
assert.strictEqual(yield r.promise(), "inner");
|
|
147
|
-
}))
|
|
148
|
-
it("can run on known unknown output value during preview",
|
|
146
|
+
}));
|
|
147
|
+
it("can run on known unknown output value during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
148
|
runtime._setIsDryRun(true);
|
|
150
149
|
const out = createOutput(0, true);
|
|
151
150
|
const r = out.apply(v => createOutput("inner", false));
|
|
152
151
|
assert.strictEqual(yield r.isKnown, false);
|
|
153
152
|
assert.strictEqual(yield r.promise(), "inner");
|
|
154
|
-
}))
|
|
155
|
-
it("produces unknown default on unknown during preview",
|
|
153
|
+
}));
|
|
154
|
+
it("produces unknown default on unknown during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
156
155
|
runtime._setIsDryRun(true);
|
|
157
156
|
const out = createOutput(0, false);
|
|
158
157
|
const r = out.apply(v => v + 1);
|
|
159
158
|
assert.strictEqual(yield r.isKnown, false);
|
|
160
159
|
assert.strictEqual(yield r.promise(), undefined);
|
|
161
|
-
}))
|
|
162
|
-
it("produces unknown default on unknown awaitable during preview",
|
|
160
|
+
}));
|
|
161
|
+
it("produces unknown default on unknown awaitable during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
163
162
|
runtime._setIsDryRun(true);
|
|
164
163
|
const out = createOutput(0, false);
|
|
165
164
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
166
165
|
assert.strictEqual(yield r.isKnown, false);
|
|
167
166
|
assert.strictEqual(yield r.promise(), undefined);
|
|
168
|
-
}))
|
|
169
|
-
it("produces unknown default on unknown known output during preview",
|
|
167
|
+
}));
|
|
168
|
+
it("produces unknown default on unknown known output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
170
169
|
runtime._setIsDryRun(true);
|
|
171
170
|
const out = createOutput(0, false);
|
|
172
171
|
const r = out.apply(v => createOutput("inner", true));
|
|
173
172
|
assert.strictEqual(yield r.isKnown, false);
|
|
174
173
|
assert.strictEqual(yield r.promise(), undefined);
|
|
175
|
-
}))
|
|
176
|
-
it("produces unknown default on unknown unknown output during preview",
|
|
174
|
+
}));
|
|
175
|
+
it("produces unknown default on unknown unknown output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
177
176
|
runtime._setIsDryRun(true);
|
|
178
177
|
const out = createOutput(0, false);
|
|
179
178
|
const r = out.apply(v => createOutput("inner", false));
|
|
180
179
|
assert.strictEqual(yield r.isKnown, false);
|
|
181
180
|
assert.strictEqual(yield r.promise(), undefined);
|
|
182
|
-
}))
|
|
183
|
-
it("preserves secret on known during preview",
|
|
181
|
+
}));
|
|
182
|
+
it("preserves secret on known during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
184
183
|
runtime._setIsDryRun(true);
|
|
185
184
|
const out = createOutput(0, true, true);
|
|
186
185
|
const r = out.apply(v => v + 1);
|
|
187
186
|
assert.strictEqual(yield r.isKnown, true);
|
|
188
187
|
assert.strictEqual(yield r.isSecret, true);
|
|
189
188
|
assert.strictEqual(yield r.promise(), 1);
|
|
190
|
-
}))
|
|
191
|
-
it("preserves secret on known awaitable during preview",
|
|
189
|
+
}));
|
|
190
|
+
it("preserves secret on known awaitable during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
192
191
|
runtime._setIsDryRun(true);
|
|
193
192
|
const out = createOutput(0, true, true);
|
|
194
193
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
195
194
|
assert.strictEqual(yield r.isKnown, true);
|
|
196
195
|
assert.strictEqual(yield r.isSecret, true);
|
|
197
196
|
assert.strictEqual(yield r.promise(), "inner");
|
|
198
|
-
}))
|
|
199
|
-
it("preserves secret on known known output during preview",
|
|
197
|
+
}));
|
|
198
|
+
it("preserves secret on known known output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
200
199
|
runtime._setIsDryRun(true);
|
|
201
200
|
const out = createOutput(0, true, true);
|
|
202
201
|
const r = out.apply(v => createOutput("inner", true));
|
|
203
202
|
assert.strictEqual(yield r.isKnown, true);
|
|
204
203
|
assert.strictEqual(yield r.isSecret, true);
|
|
205
204
|
assert.strictEqual(yield r.promise(), "inner");
|
|
206
|
-
}))
|
|
207
|
-
it("preserves secret on known unknown output during preview",
|
|
205
|
+
}));
|
|
206
|
+
it("preserves secret on known unknown output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
208
207
|
runtime._setIsDryRun(true);
|
|
209
208
|
const out = createOutput(0, true, true);
|
|
210
209
|
const r = out.apply(v => createOutput("inner", false));
|
|
211
210
|
assert.strictEqual(yield r.isKnown, false);
|
|
212
211
|
assert.strictEqual(yield r.isSecret, true);
|
|
213
212
|
assert.strictEqual(yield r.promise(), "inner");
|
|
214
|
-
}))
|
|
215
|
-
it("preserves secret on unknown during preview",
|
|
213
|
+
}));
|
|
214
|
+
it("preserves secret on unknown during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
216
215
|
runtime._setIsDryRun(true);
|
|
217
216
|
const out = createOutput(0, false, true);
|
|
218
217
|
const r = out.apply(v => v + 1);
|
|
219
218
|
assert.strictEqual(yield r.isKnown, false);
|
|
220
219
|
assert.strictEqual(yield r.isSecret, true);
|
|
221
220
|
assert.strictEqual(yield r.promise(), undefined);
|
|
222
|
-
}))
|
|
223
|
-
it("preserves secret on unknown awaitable during preview",
|
|
221
|
+
}));
|
|
222
|
+
it("preserves secret on unknown awaitable during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
224
223
|
runtime._setIsDryRun(true);
|
|
225
224
|
const out = createOutput(0, false, true);
|
|
226
225
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
227
226
|
assert.strictEqual(yield r.isKnown, false);
|
|
228
227
|
assert.strictEqual(yield r.isSecret, true);
|
|
229
228
|
assert.strictEqual(yield r.promise(), undefined);
|
|
230
|
-
}))
|
|
231
|
-
it("preserves secret on unknown known output during preview",
|
|
229
|
+
}));
|
|
230
|
+
it("preserves secret on unknown known output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
232
231
|
runtime._setIsDryRun(true);
|
|
233
232
|
const out = createOutput(0, false, true);
|
|
234
233
|
const r = out.apply(v => createOutput("inner", true));
|
|
235
234
|
assert.strictEqual(yield r.isKnown, false);
|
|
236
235
|
assert.strictEqual(yield r.isSecret, true);
|
|
237
236
|
assert.strictEqual(yield r.promise(), undefined);
|
|
238
|
-
}))
|
|
239
|
-
it("preserves secret on unknown unknown output during preview",
|
|
237
|
+
}));
|
|
238
|
+
it("preserves secret on unknown unknown output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
240
239
|
runtime._setIsDryRun(true);
|
|
241
240
|
const out = createOutput(0, false, true);
|
|
242
241
|
const r = out.apply(v => createOutput("inner", false));
|
|
243
242
|
assert.strictEqual(yield r.isKnown, false);
|
|
244
243
|
assert.strictEqual(yield r.isSecret, true);
|
|
245
244
|
assert.strictEqual(yield r.promise(), undefined);
|
|
246
|
-
}))
|
|
247
|
-
it("propagates secret on known known output during preview",
|
|
245
|
+
}));
|
|
246
|
+
it("propagates secret on known known output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
248
247
|
runtime._setIsDryRun(true);
|
|
249
248
|
const out = createOutput(0, true);
|
|
250
249
|
const r = out.apply(v => createOutput("inner", true, true));
|
|
251
250
|
assert.strictEqual(yield r.isKnown, true);
|
|
252
251
|
assert.strictEqual(yield r.isSecret, true);
|
|
253
252
|
assert.strictEqual(yield r.promise(), "inner");
|
|
254
|
-
}))
|
|
255
|
-
it("propagates secret on known unknown output during preview",
|
|
253
|
+
}));
|
|
254
|
+
it("propagates secret on known unknown output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
256
255
|
runtime._setIsDryRun(true);
|
|
257
256
|
const out = createOutput(0, true);
|
|
258
257
|
const r = out.apply(v => createOutput("inner", false, true));
|
|
259
258
|
assert.strictEqual(yield r.isKnown, false);
|
|
260
259
|
assert.strictEqual(yield r.isSecret, true);
|
|
261
260
|
assert.strictEqual(yield r.promise(), "inner");
|
|
262
|
-
}))
|
|
263
|
-
it("does not propagate secret on unknown known output during preview",
|
|
261
|
+
}));
|
|
262
|
+
it("does not propagate secret on unknown known output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
264
263
|
runtime._setIsDryRun(true);
|
|
265
264
|
const out = createOutput(0, false);
|
|
266
265
|
const r = out.apply(v => createOutput("inner", true, true));
|
|
267
266
|
assert.strictEqual(yield r.isKnown, false);
|
|
268
267
|
assert.strictEqual(yield r.isSecret, false);
|
|
269
268
|
assert.strictEqual(yield r.promise(), undefined);
|
|
270
|
-
}))
|
|
271
|
-
it("does not propagate secret on unknown unknown output during preview",
|
|
269
|
+
}));
|
|
270
|
+
it("does not propagate secret on unknown unknown output during preview", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
272
271
|
runtime._setIsDryRun(true);
|
|
273
272
|
const out = createOutput(0, false);
|
|
274
273
|
const r = out.apply(v => createOutput("inner", false, true));
|
|
275
274
|
assert.strictEqual(yield r.isKnown, false);
|
|
276
275
|
assert.strictEqual(yield r.isSecret, false);
|
|
277
276
|
assert.strictEqual(yield r.promise(), undefined);
|
|
278
|
-
}))
|
|
279
|
-
it("can run on known value",
|
|
277
|
+
}));
|
|
278
|
+
it("can run on known value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
280
279
|
runtime._setIsDryRun(false);
|
|
281
280
|
const out = createOutput(0, true);
|
|
282
281
|
const r = out.apply(v => v + 1);
|
|
283
282
|
assert.strictEqual(yield r.isKnown, true);
|
|
284
283
|
assert.strictEqual(yield r.promise(), 1);
|
|
285
|
-
}))
|
|
286
|
-
it("can run on known awaitable value",
|
|
284
|
+
}));
|
|
285
|
+
it("can run on known awaitable value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
287
286
|
runtime._setIsDryRun(false);
|
|
288
287
|
const out = createOutput(0, true);
|
|
289
288
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
290
289
|
assert.strictEqual(yield r.isKnown, true);
|
|
291
290
|
assert.strictEqual(yield r.promise(), "inner");
|
|
292
|
-
}))
|
|
293
|
-
it("can run on known known output value",
|
|
291
|
+
}));
|
|
292
|
+
it("can run on known known output value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
294
293
|
runtime._setIsDryRun(false);
|
|
295
294
|
const out = createOutput(0, true);
|
|
296
295
|
const r = out.apply(v => createOutput("inner", true));
|
|
297
296
|
assert.strictEqual(yield r.isKnown, true);
|
|
298
297
|
assert.strictEqual(yield r.promise(), "inner");
|
|
299
|
-
}))
|
|
300
|
-
it("can run on unknown known output value",
|
|
298
|
+
}));
|
|
299
|
+
it("can run on unknown known output value", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
301
300
|
runtime._setIsDryRun(false);
|
|
302
301
|
const out = createOutput(0, true);
|
|
303
302
|
const r = out.apply(v => createOutput("inner", false));
|
|
304
303
|
assert.strictEqual(yield r.isKnown, false);
|
|
305
304
|
assert.strictEqual(yield r.promise(), "inner");
|
|
306
|
-
}))
|
|
307
|
-
it("produces known on unknown",
|
|
305
|
+
}));
|
|
306
|
+
it("produces known on unknown", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
308
307
|
runtime._setIsDryRun(false);
|
|
309
308
|
const out = createOutput(0, false);
|
|
310
309
|
const r = out.apply(v => v + 1);
|
|
311
310
|
assert.strictEqual(yield r.isKnown, true);
|
|
312
311
|
assert.strictEqual(yield r.promise(), 1);
|
|
313
|
-
}))
|
|
314
|
-
it("produces known on unknown awaitable",
|
|
312
|
+
}));
|
|
313
|
+
it("produces known on unknown awaitable", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
315
314
|
runtime._setIsDryRun(false);
|
|
316
315
|
const out = createOutput(0, false);
|
|
317
316
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
318
317
|
assert.strictEqual(yield r.isKnown, true);
|
|
319
318
|
assert.strictEqual(yield r.promise(), "inner");
|
|
320
|
-
}))
|
|
321
|
-
it("produces known on unknown known output",
|
|
319
|
+
}));
|
|
320
|
+
it("produces known on unknown known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
322
321
|
runtime._setIsDryRun(false);
|
|
323
322
|
const out = createOutput(0, false);
|
|
324
323
|
const r = out.apply(v => createOutput("inner", true));
|
|
325
324
|
assert.strictEqual(yield r.isKnown, true);
|
|
326
325
|
assert.strictEqual(yield r.promise(), "inner");
|
|
327
|
-
}))
|
|
328
|
-
it("produces unknown on unknown unknown output",
|
|
326
|
+
}));
|
|
327
|
+
it("produces unknown on unknown unknown output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
329
328
|
runtime._setIsDryRun(false);
|
|
330
329
|
const out = createOutput(0, false);
|
|
331
330
|
const r = out.apply(v => createOutput("inner", false));
|
|
332
331
|
assert.strictEqual(yield r.isKnown, false);
|
|
333
332
|
assert.strictEqual(yield r.promise(), "inner");
|
|
334
|
-
}))
|
|
335
|
-
it("preserves secret on known",
|
|
333
|
+
}));
|
|
334
|
+
it("preserves secret on known", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
336
335
|
runtime._setIsDryRun(false);
|
|
337
336
|
const out = createOutput(0, true, true);
|
|
338
337
|
const r = out.apply(v => v + 1);
|
|
339
338
|
assert.strictEqual(yield r.isKnown, true);
|
|
340
339
|
assert.strictEqual(yield r.isSecret, true);
|
|
341
340
|
assert.strictEqual(yield r.promise(), 1);
|
|
342
|
-
}))
|
|
343
|
-
it("preserves secret on known awaitable",
|
|
341
|
+
}));
|
|
342
|
+
it("preserves secret on known awaitable", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
344
343
|
runtime._setIsDryRun(false);
|
|
345
344
|
const out = createOutput(0, true, true);
|
|
346
345
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
347
346
|
assert.strictEqual(yield r.isKnown, true);
|
|
348
347
|
assert.strictEqual(yield r.isSecret, true);
|
|
349
348
|
assert.strictEqual(yield r.promise(), "inner");
|
|
350
|
-
}))
|
|
351
|
-
it("preserves secret on known known output",
|
|
349
|
+
}));
|
|
350
|
+
it("preserves secret on known known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
352
351
|
runtime._setIsDryRun(false);
|
|
353
352
|
const out = createOutput(0, true, true);
|
|
354
353
|
const r = out.apply(v => createOutput("inner", true));
|
|
355
354
|
assert.strictEqual(yield r.isKnown, true);
|
|
356
355
|
assert.strictEqual(yield r.isSecret, true);
|
|
357
356
|
assert.strictEqual(yield r.promise(), "inner");
|
|
358
|
-
}))
|
|
359
|
-
it("preserves secret on known known output",
|
|
357
|
+
}));
|
|
358
|
+
it("preserves secret on known known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
360
359
|
runtime._setIsDryRun(false);
|
|
361
360
|
const out = createOutput(0, true, true);
|
|
362
361
|
const r = out.apply(v => createOutput("inner", false));
|
|
363
362
|
assert.strictEqual(yield r.isKnown, false);
|
|
364
363
|
assert.strictEqual(yield r.isSecret, true);
|
|
365
364
|
assert.strictEqual(yield r.promise(), "inner");
|
|
366
|
-
}))
|
|
367
|
-
it("preserves secret on unknown",
|
|
365
|
+
}));
|
|
366
|
+
it("preserves secret on unknown", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
368
367
|
runtime._setIsDryRun(false);
|
|
369
368
|
const out = createOutput(0, false, true);
|
|
370
369
|
const r = out.apply(v => v + 1);
|
|
371
370
|
assert.strictEqual(yield r.isKnown, true);
|
|
372
371
|
assert.strictEqual(yield r.isSecret, true);
|
|
373
372
|
assert.strictEqual(yield r.promise(), 1);
|
|
374
|
-
}))
|
|
375
|
-
it("preserves secret on unknown awaitable",
|
|
373
|
+
}));
|
|
374
|
+
it("preserves secret on unknown awaitable", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
376
375
|
runtime._setIsDryRun(false);
|
|
377
376
|
const out = createOutput(0, false, true);
|
|
378
377
|
const r = out.apply(v => Promise.resolve("inner"));
|
|
379
378
|
assert.strictEqual(yield r.isKnown, true);
|
|
380
379
|
assert.strictEqual(yield r.isSecret, true);
|
|
381
380
|
assert.strictEqual(yield r.promise(), "inner");
|
|
382
|
-
}))
|
|
383
|
-
it("preserves secret on unknown known output",
|
|
381
|
+
}));
|
|
382
|
+
it("preserves secret on unknown known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
384
383
|
runtime._setIsDryRun(false);
|
|
385
384
|
const out = createOutput(0, false, true);
|
|
386
385
|
const r = out.apply(v => createOutput("inner", true));
|
|
387
386
|
assert.strictEqual(yield r.isKnown, true);
|
|
388
387
|
assert.strictEqual(yield r.isSecret, true);
|
|
389
388
|
assert.strictEqual(yield r.promise(), "inner");
|
|
390
|
-
}))
|
|
391
|
-
it("preserves secret on unknown known output",
|
|
389
|
+
}));
|
|
390
|
+
it("preserves secret on unknown known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
392
391
|
runtime._setIsDryRun(false);
|
|
393
392
|
const out = createOutput(0, false, true);
|
|
394
393
|
const r = out.apply(v => createOutput("inner", false));
|
|
395
394
|
assert.strictEqual(yield r.isKnown, false);
|
|
396
395
|
assert.strictEqual(yield r.isSecret, true);
|
|
397
396
|
assert.strictEqual(yield r.promise(), "inner");
|
|
398
|
-
}))
|
|
399
|
-
it("propagates secret on known known output",
|
|
397
|
+
}));
|
|
398
|
+
it("propagates secret on known known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
400
399
|
runtime._setIsDryRun(false);
|
|
401
400
|
const out = createOutput(0, true);
|
|
402
401
|
const r = out.apply(v => createOutput("inner", true, true));
|
|
403
402
|
assert.strictEqual(yield r.isKnown, true);
|
|
404
403
|
assert.strictEqual(yield r.isSecret, true);
|
|
405
404
|
assert.strictEqual(yield r.promise(), "inner");
|
|
406
|
-
}))
|
|
407
|
-
it("propagates secret on known unknown output",
|
|
405
|
+
}));
|
|
406
|
+
it("propagates secret on known unknown output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
408
407
|
runtime._setIsDryRun(false);
|
|
409
408
|
const out = createOutput(0, true);
|
|
410
409
|
const r = out.apply(v => createOutput("inner", false, true));
|
|
411
410
|
assert.strictEqual(yield r.isKnown, false);
|
|
412
411
|
assert.strictEqual(yield r.isSecret, true);
|
|
413
412
|
assert.strictEqual(yield r.promise(), "inner");
|
|
414
|
-
}))
|
|
415
|
-
it("propagates secret on unknown known output",
|
|
413
|
+
}));
|
|
414
|
+
it("propagates secret on unknown known output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
416
415
|
runtime._setIsDryRun(false);
|
|
417
416
|
const out = createOutput(0, false);
|
|
418
417
|
const r = out.apply(v => createOutput("inner", true, true));
|
|
419
418
|
assert.strictEqual(yield r.isKnown, true);
|
|
420
419
|
assert.strictEqual(yield r.isSecret, true);
|
|
421
420
|
assert.strictEqual(yield r.promise(), "inner");
|
|
422
|
-
}))
|
|
423
|
-
it("propagates secret on unknown uknown output",
|
|
421
|
+
}));
|
|
422
|
+
it("propagates secret on unknown uknown output", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
424
423
|
runtime._setIsDryRun(false);
|
|
425
424
|
const out = createOutput(0, false);
|
|
426
425
|
const r = out.apply(v => createOutput("inner", false, true));
|
|
427
426
|
assert.strictEqual(yield r.isKnown, false);
|
|
428
427
|
assert.strictEqual(yield r.isSecret, true);
|
|
429
428
|
assert.strictEqual(yield r.promise(), "inner");
|
|
430
|
-
}))
|
|
429
|
+
}));
|
|
431
430
|
});
|
|
432
431
|
describe("isKnown", () => {
|
|
433
432
|
function or(output1, output2) {
|
|
@@ -439,7 +438,7 @@ describe("output", () => {
|
|
|
439
438
|
.then(([val1, isSecret1, isSecret2]) => val1 ? isSecret1 : isSecret2), Promise.all([output1.allResources(), output2.allResources()])
|
|
440
439
|
.then(([r1, r2]) => new Set([...r1, ...r2])));
|
|
441
440
|
}
|
|
442
|
-
it("choose between known and known output, non-secret",
|
|
441
|
+
it("choose between known and known output, non-secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
443
442
|
runtime._setIsDryRun(true);
|
|
444
443
|
const o1 = new output_1.Output(new Set(), Promise.resolve("foo"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
445
444
|
const o2 = new output_1.Output(new Set(), Promise.resolve("bar"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -450,8 +449,8 @@ describe("output", () => {
|
|
|
450
449
|
assert.strictEqual(value, "foo");
|
|
451
450
|
const secret = yield result.isSecret;
|
|
452
451
|
assert.strictEqual(secret, false);
|
|
453
|
-
}))
|
|
454
|
-
it("choose between known and known output, secret",
|
|
452
|
+
}));
|
|
453
|
+
it("choose between known and known output, secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
455
454
|
runtime._setIsDryRun(true);
|
|
456
455
|
const o1 = new output_1.Output(new Set(), Promise.resolve("foo"), Promise.resolve(true), Promise.resolve(true), Promise.resolve(new Set()));
|
|
457
456
|
const o2 = new output_1.Output(new Set(), Promise.resolve("bar"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -462,8 +461,8 @@ describe("output", () => {
|
|
|
462
461
|
assert.strictEqual(value, "foo");
|
|
463
462
|
const secret = yield result.isSecret;
|
|
464
463
|
assert.strictEqual(secret, true);
|
|
465
|
-
}))
|
|
466
|
-
it("choose between known and unknown output, non-secret",
|
|
464
|
+
}));
|
|
465
|
+
it("choose between known and unknown output, non-secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
467
466
|
runtime._setIsDryRun(true);
|
|
468
467
|
const o1 = new output_1.Output(new Set(), Promise.resolve("foo"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
469
468
|
const o2 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -474,8 +473,8 @@ describe("output", () => {
|
|
|
474
473
|
assert.strictEqual(value, "foo");
|
|
475
474
|
const secret = yield result.isSecret;
|
|
476
475
|
assert.strictEqual(secret, false);
|
|
477
|
-
}))
|
|
478
|
-
it("choose between known and unknown output, secret",
|
|
476
|
+
}));
|
|
477
|
+
it("choose between known and unknown output, secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
479
478
|
runtime._setIsDryRun(true);
|
|
480
479
|
const o1 = new output_1.Output(new Set(), Promise.resolve("foo"), Promise.resolve(true), Promise.resolve(true), Promise.resolve(new Set()));
|
|
481
480
|
const o2 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -486,8 +485,8 @@ describe("output", () => {
|
|
|
486
485
|
assert.strictEqual(value, "foo");
|
|
487
486
|
const secret = yield result.isSecret;
|
|
488
487
|
assert.strictEqual(secret, true);
|
|
489
|
-
}))
|
|
490
|
-
it("choose between unknown and known output, non-secret",
|
|
488
|
+
}));
|
|
489
|
+
it("choose between unknown and known output, non-secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
491
490
|
runtime._setIsDryRun(true);
|
|
492
491
|
const o1 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
493
492
|
const o2 = new output_1.Output(new Set(), Promise.resolve("bar"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -498,8 +497,8 @@ describe("output", () => {
|
|
|
498
497
|
assert.strictEqual(value, "bar");
|
|
499
498
|
const secret = yield result.isSecret;
|
|
500
499
|
assert.strictEqual(secret, false);
|
|
501
|
-
}))
|
|
502
|
-
it("choose between unknown and known output, secret",
|
|
500
|
+
}));
|
|
501
|
+
it("choose between unknown and known output, secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
503
502
|
runtime._setIsDryRun(true);
|
|
504
503
|
const o1 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
505
504
|
const o2 = new output_1.Output(new Set(), Promise.resolve("bar"), Promise.resolve(true), Promise.resolve(true), Promise.resolve(new Set()));
|
|
@@ -510,8 +509,8 @@ describe("output", () => {
|
|
|
510
509
|
assert.strictEqual(value, "bar");
|
|
511
510
|
const secret = yield result.isSecret;
|
|
512
511
|
assert.strictEqual(secret, true);
|
|
513
|
-
}))
|
|
514
|
-
it("choose between unknown and unknown output, non-secret",
|
|
512
|
+
}));
|
|
513
|
+
it("choose between unknown and unknown output, non-secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
515
514
|
runtime._setIsDryRun(true);
|
|
516
515
|
const o1 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
517
516
|
const o2 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -522,8 +521,8 @@ describe("output", () => {
|
|
|
522
521
|
assert.strictEqual(value, undefined);
|
|
523
522
|
const secret = yield result.isSecret;
|
|
524
523
|
assert.strictEqual(secret, false);
|
|
525
|
-
}))
|
|
526
|
-
it("choose between unknown and unknown output, secret1",
|
|
524
|
+
}));
|
|
525
|
+
it("choose between unknown and unknown output, secret1", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
527
526
|
runtime._setIsDryRun(true);
|
|
528
527
|
const o1 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(true), Promise.resolve(new Set()));
|
|
529
528
|
const o2 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -534,8 +533,8 @@ describe("output", () => {
|
|
|
534
533
|
assert.strictEqual(value, undefined);
|
|
535
534
|
const secret = yield result.isSecret;
|
|
536
535
|
assert.strictEqual(secret, false);
|
|
537
|
-
}))
|
|
538
|
-
it("choose between unknown and unknown output, secret2",
|
|
536
|
+
}));
|
|
537
|
+
it("choose between unknown and unknown output, secret2", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
539
538
|
runtime._setIsDryRun(true);
|
|
540
539
|
const o1 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(false), Promise.resolve(new Set()));
|
|
541
540
|
const o2 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(true), Promise.resolve(new Set()));
|
|
@@ -546,8 +545,8 @@ describe("output", () => {
|
|
|
546
545
|
assert.strictEqual(value, undefined);
|
|
547
546
|
const secret = yield result.isSecret;
|
|
548
547
|
assert.strictEqual(secret, true);
|
|
549
|
-
}))
|
|
550
|
-
it("choose between unknown and unknown output, secret3",
|
|
548
|
+
}));
|
|
549
|
+
it("choose between unknown and unknown output, secret3", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
551
550
|
runtime._setIsDryRun(true);
|
|
552
551
|
const o1 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(true), Promise.resolve(new Set()));
|
|
553
552
|
const o2 = new output_1.Output(new Set(), Promise.resolve(undefined), Promise.resolve(false), Promise.resolve(true), Promise.resolve(new Set()));
|
|
@@ -558,8 +557,8 @@ describe("output", () => {
|
|
|
558
557
|
assert.strictEqual(value, undefined);
|
|
559
558
|
const secret = yield result.isSecret;
|
|
560
559
|
assert.strictEqual(secret, true);
|
|
561
|
-
}))
|
|
562
|
-
it("is unknown if the value is or contains unknowns",
|
|
560
|
+
}));
|
|
561
|
+
it("is unknown if the value is or contains unknowns", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
563
562
|
runtime._setIsDryRun(true);
|
|
564
563
|
const o1 = new output_1.Output(new Set(), Promise.resolve(output_1.unknown), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
565
564
|
const o2 = new output_1.Output(new Set(), Promise.resolve(["foo", output_1.unknown]), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
@@ -567,8 +566,8 @@ describe("output", () => {
|
|
|
567
566
|
assert.strictEqual(yield o1.isKnown, false);
|
|
568
567
|
assert.strictEqual(yield o2.isKnown, false);
|
|
569
568
|
assert.strictEqual(yield o3.isKnown, false);
|
|
570
|
-
}))
|
|
571
|
-
it("is unknown if the result after apply is unknown or contains unknowns",
|
|
569
|
+
}));
|
|
570
|
+
it("is unknown if the result after apply is unknown or contains unknowns", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
572
571
|
runtime._setIsDryRun(true);
|
|
573
572
|
const o1 = new output_1.Output(new Set(), Promise.resolve("foo"), Promise.resolve(true), Promise.resolve(false), Promise.resolve(new Set()));
|
|
574
573
|
const r1 = o1.apply(v => output_1.unknown);
|
|
@@ -583,75 +582,75 @@ describe("output", () => {
|
|
|
583
582
|
assert.strictEqual(yield r4.isKnown, false);
|
|
584
583
|
assert.strictEqual(yield r5.isKnown, false);
|
|
585
584
|
assert.strictEqual(yield r6.isKnown, false);
|
|
586
|
-
}))
|
|
585
|
+
}));
|
|
587
586
|
});
|
|
588
587
|
describe("concat", () => {
|
|
589
|
-
it("handles no args",
|
|
588
|
+
it("handles no args", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
590
589
|
const result = output_1.concat();
|
|
591
590
|
assert.strictEqual(yield result.promise(), "");
|
|
592
|
-
}))
|
|
593
|
-
it("handles empty string arg",
|
|
591
|
+
}));
|
|
592
|
+
it("handles empty string arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
594
593
|
const result = output_1.concat("");
|
|
595
594
|
assert.strictEqual(yield result.promise(), "");
|
|
596
|
-
}))
|
|
597
|
-
it("handles non-empty string arg",
|
|
595
|
+
}));
|
|
596
|
+
it("handles non-empty string arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
598
597
|
const result = output_1.concat("a");
|
|
599
598
|
assert.strictEqual(yield result.promise(), "a");
|
|
600
|
-
}))
|
|
601
|
-
it("handles promise string arg",
|
|
599
|
+
}));
|
|
600
|
+
it("handles promise string arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
602
601
|
const result = output_1.concat(Promise.resolve("a"));
|
|
603
602
|
assert.strictEqual(yield result.promise(), "a");
|
|
604
|
-
}))
|
|
605
|
-
it("handles output string arg",
|
|
603
|
+
}));
|
|
604
|
+
it("handles output string arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
606
605
|
const result = output_1.concat(output_1.output("a"));
|
|
607
606
|
assert.strictEqual(yield result.promise(), "a");
|
|
608
|
-
}))
|
|
609
|
-
it("handles multiple args",
|
|
607
|
+
}));
|
|
608
|
+
it("handles multiple args", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
610
609
|
const result = output_1.concat("http://", output_1.output("a"), ":", 80);
|
|
611
610
|
assert.strictEqual(yield result.promise(), "http://a:80");
|
|
612
|
-
}))
|
|
611
|
+
}));
|
|
613
612
|
});
|
|
614
613
|
describe("interpolate", () => {
|
|
615
|
-
it("handles empty interpolation",
|
|
614
|
+
it("handles empty interpolation", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
616
615
|
const result = output_1.interpolate ``;
|
|
617
616
|
assert.strictEqual(yield result.promise(), "");
|
|
618
|
-
}))
|
|
619
|
-
it("handles no placeholders arg",
|
|
617
|
+
}));
|
|
618
|
+
it("handles no placeholders arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
620
619
|
const result = output_1.interpolate `a`;
|
|
621
620
|
assert.strictEqual(yield result.promise(), "a");
|
|
622
|
-
}))
|
|
623
|
-
it("handles string placeholders arg",
|
|
621
|
+
}));
|
|
622
|
+
it("handles string placeholders arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
624
623
|
const result = output_1.interpolate `${"a"}`;
|
|
625
624
|
assert.strictEqual(yield result.promise(), "a");
|
|
626
|
-
}))
|
|
627
|
-
it("handles promise placeholders arg",
|
|
625
|
+
}));
|
|
626
|
+
it("handles promise placeholders arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
628
627
|
const result = output_1.interpolate `${Promise.resolve("a")}`;
|
|
629
628
|
assert.strictEqual(yield result.promise(), "a");
|
|
630
|
-
}))
|
|
631
|
-
it("handles output placeholders arg",
|
|
629
|
+
}));
|
|
630
|
+
it("handles output placeholders arg", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
632
631
|
const result = output_1.interpolate `${output_1.output("a")}`;
|
|
633
632
|
assert.strictEqual(yield result.promise(), "a");
|
|
634
|
-
}))
|
|
635
|
-
it("handles multiple args",
|
|
633
|
+
}));
|
|
634
|
+
it("handles multiple args", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
636
635
|
const result = output_1.interpolate `http://${output_1.output("a")}:${80}/`;
|
|
637
636
|
assert.strictEqual(yield result.promise(), "http://a:80/");
|
|
638
|
-
}))
|
|
637
|
+
}));
|
|
639
638
|
});
|
|
640
639
|
describe("secret operations", () => {
|
|
641
|
-
it("ensure secret",
|
|
640
|
+
it("ensure secret", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
642
641
|
const sec = output_1.secret("foo");
|
|
643
642
|
assert.strictEqual(yield sec.isSecret, true);
|
|
644
|
-
}))
|
|
645
|
-
it("ensure that a secret can be unwrapped",
|
|
643
|
+
}));
|
|
644
|
+
it("ensure that a secret can be unwrapped", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
646
645
|
const sec = output_1.secret("foo");
|
|
647
646
|
assert.strictEqual(yield output_1.isSecret(sec), true);
|
|
648
647
|
const unsec = output_1.unsecret(sec);
|
|
649
648
|
assert.strictEqual(yield output_1.isSecret(unsec), false);
|
|
650
649
|
assert.strictEqual(yield unsec.promise(), "foo");
|
|
651
|
-
}))
|
|
650
|
+
}));
|
|
652
651
|
});
|
|
653
652
|
describe("lifted operations", () => {
|
|
654
|
-
it("lifts properties from inner object",
|
|
653
|
+
it("lifts properties from inner object", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
655
654
|
const output1 = output_1.output({ a: 1, b: true, c: "str", d: [2], e: { f: 3 }, g: undefined, h: null });
|
|
656
655
|
assert.strictEqual(yield output1.a.promise(), 1);
|
|
657
656
|
assert.strictEqual(yield output1.b.promise(), true);
|
|
@@ -667,21 +666,21 @@ describe("output", () => {
|
|
|
667
666
|
// Unspecified things can be lifted, but produce 'undefined'.
|
|
668
667
|
assert.notEqual(output1.z, undefined);
|
|
669
668
|
assert.strictEqual(yield output1.z.promise(), undefined);
|
|
670
|
-
}))
|
|
671
|
-
it("prefers Output members over lifted members",
|
|
669
|
+
}));
|
|
670
|
+
it("prefers Output members over lifted members", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
672
671
|
const output1 = output_1.output({ apply: 1, promise: 2 });
|
|
673
672
|
assert.ok(output1.apply instanceof Function);
|
|
674
673
|
assert.ok(output1.isKnown instanceof Promise);
|
|
675
|
-
}))
|
|
676
|
-
it("does not lift symbols",
|
|
674
|
+
}));
|
|
675
|
+
it("does not lift symbols", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
677
676
|
const output1 = output_1.output({ apply: 1, promise: 2 });
|
|
678
677
|
assert.strictEqual(output1[Symbol.toPrimitive], undefined);
|
|
679
|
-
}))
|
|
680
|
-
it("does not lift __ properties",
|
|
678
|
+
}));
|
|
679
|
+
it("does not lift __ properties", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
681
680
|
const output1 = output_1.output({ a: 1, b: 2 });
|
|
682
681
|
assert.strictEqual(output1.__pulumiResource, undefined);
|
|
683
|
-
}))
|
|
684
|
-
it("lifts properties from values with nested unknowns",
|
|
682
|
+
}));
|
|
683
|
+
it("lifts properties from values with nested unknowns", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
685
684
|
runtime._setIsDryRun(true);
|
|
686
685
|
const output1 = output_1.output({
|
|
687
686
|
foo: "foo",
|
|
@@ -752,7 +751,7 @@ describe("output", () => {
|
|
|
752
751
|
const result18 = result16.qux;
|
|
753
752
|
assert.strictEqual(yield result18.isKnown, false);
|
|
754
753
|
assert.strictEqual(yield result18.promise(/*withUnknowns*/ true), output_1.unknown);
|
|
755
|
-
}))
|
|
754
|
+
}));
|
|
756
755
|
});
|
|
757
756
|
});
|
|
758
757
|
//# sourceMappingURL=output.spec.js.map
|