From 63ca62a96bbc16ac3bd46b6dc6f46506a20483d7 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Tue, 27 Feb 2018 22:26:30 -0600 Subject: [PATCH] add start of tests --- .../postman-collection-tests.ts | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/types/postman-collection/postman-collection-tests.ts b/types/postman-collection/postman-collection-tests.ts index fd65e5e3d9..9f98e7d689 100644 --- a/types/postman-collection/postman-collection-tests.ts +++ b/types/postman-collection/postman-collection-tests.ts @@ -1,7 +1,26 @@ import * as pmCollection from 'postman-collection'; -/* Example https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/base64-js/base64-js-tests.ts -base64js.byteLength(""); // $ExpectType number -base64js.toByteArray(""); // $ExpectType Uint8Array -base64js.fromByteArray(new Uint8Array(0)); // $ExpectType string -*/ +const certificate = new pmCollection.Certificate({}); +certificate.cert; // $ExpectType any +certificate.id; // $ExpectType string +certificate.key; // $ExpectType any +certificate.matches; // $ExpectType any[] +certificate.name; // $ExpectType string +certificate.passphrase; // $ExpectType string +certificate.auth; // $ExpectType RequestAuth +certificate.disabled; // $ExpectType boolean + +certificate.canApplyTo("string"); // $ExpectType any +certificate.canApplyTo(new pmCollection.Url({})); // $ExpectType any + +certificate.toJSON(); // $ExpectType CertificateDefinition +certificate.update({}); // $ExpectType void + +certificate as pmCollection.Property; // $ExpectType Property + +pmCollection.Certificate.isCertificate(certificate); // $ExpectType boolean + +let collection: pmCollection.Collection; +collection = new pmCollection.Collection(); +collection = new pmCollection.Collection({}); +collection = new pmCollection.Collection({}, []);