fix(start supporting workers again): update

This commit is contained in:
2024-06-17 01:36:39 +02:00
parent 902ca30529
commit b0f8d1e4d0
7 changed files with 83 additions and 24 deletions

View File

@ -14,18 +14,23 @@ tap.test('should create a valid instance of CloudflareAccount', async () => {
testCloudflareAccount = new cloudflare.CloudflareAccount(await testQenv.getEnvVarOnDemand('CF_KEY'));
});
tap.test('should preselect an account', async () => {
await testCloudflareAccount.preselectAccountByName('Sandbox Account');
})
tap.test('.listZones() -> should display an entire account', async (tools) => {
tools.timeout(600000);
const result = await testCloudflareAccount.convenience.listZones();
console.log(result);
await tools.delayFor(10000);
// await tools.delayFor(10000);
});
tap.test(
'.getZoneId(domainName) -> should get an Cloudflare Id for a domain string',
async (tools) => {
tools.timeout(600000);
await testCloudflareAccount.convenience.getZoneId('bleu.de');
const id = await testCloudflareAccount.convenience.getZoneId('bleu.de');
console.log(`The account id for bleu.de is: ${id}`);
}
);
@ -71,6 +76,11 @@ tap.test('.purge(some.domain) -> should purge everything', async () => {
await testCloudflareAccount.convenience.purgeZone('bleu.de');
});
tap.test('should list workers', async () => {
const workerArray = await testCloudflareAccount.workerManager.listWorkerScripts();
console.log(workerArray);
});
// WORKERS
tap.test('should create a worker', async () => {
const worker = await testCloudflareAccount.workerManager.createWorker(
@ -86,8 +96,8 @@ tap.test('should create a worker', async () => {
console.log(worker);
});
tap.test('should get workers', async () => {
const workerArray = await testCloudflareAccount.workerManager.listWorkers();
tap.test('should get workers again', async () => {
const workerArray = await testCloudflareAccount.workerManager.listWorkerScripts();
console.log(workerArray);
});