worried-engineer-33884
05/30/2019, 3:50 PMexport class BucketPolicy extends aws.s3.BucketPolicy {
constructor(name: string, bucket: aws.s3.Bucket) {
const bucketPolicyArgs = {
bucket: bucket.id,
policy: "",
}
super(name, bucketPolicyArgs);
}
}
and in my test i have
describe("BucketPolicy", function() {
describe("constructor", function() {
let testBucket = new infra.Bucket("test");
let bucketPolicy = new infra.BucketPolicy("test", testBucket);
it("should attach to the given bucket", function(done) {
bucketPolicy.bucket.apply(bucketId => { // this hangs
if (bucketId == "test") {
done()
} else {
done(new Error(`wrong bucket id ${bucketId}`))
}
})
});
the test hangs when it tries to retrieve the bucket output from bucketPolicypulumi preview
doesn't seem to have any problem with this when i instantiate BucketPolicy — it's just the test that seems to have trouble resolving the outputwhite-balloon-205
aws.s3.BucketPolicy
instead of creating a subclass of it?worried-engineer-33884
05/30/2019, 4:25 PMdescribe("constructor", function() {
let testBucket = new aws.s3.Bucket("test");
let bucketPolicy = new aws.s3.BucketPolicy("test", {
bucket: testBucket.id,
policy: ""
});
it("should attach to the given bucket", function(done) {
bucketPolicy.bucket.apply(bucketId => {
if (bucketId == "test") {
done();
} else {
done(new Error(`wrong bucket id ${bucketId}`))
}
})
});
white-balloon-205
worried-engineer-33884
05/30/2019, 4:31 PM