forked from GoogleCloudPlatform/nodejs-docs-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent-cache-create-use-update-delete.test.js
More file actions
39 lines (31 loc) · 1.23 KB
/
content-cache-create-use-update-delete.test.js
File metadata and controls
39 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
const {assert} = require('chai');
const {describe, it} = require('mocha');
const projectId = process.env.CAIP_PROJECT_ID;
const createSample = require('../content-cache/content-cache-create-with-txt-gcs-pdf.js');
const useSample = require('../content-cache/content-cache-use-with-txt.js');
const updateSample = require('../content-cache/content-cache-update.js');
const deleteSample = require('../content-cache/content-cache-delete.js');
describe('content-cache-create-use-update-delete', function () {
this.timeout(60000);
let contentCacheName;
it('should create content cache', async () => {
contentCacheName = await createSample.generateContent(projectId);
assert.isString(contentCacheName);
assert.isAbove(contentCacheName.length, 0);
});
it('should update content cache', async () => {
await updateSample.generateContent(projectId, undefined, contentCacheName);
});
it('should use content cache', async () => {
const response = await useSample.generateContent(
projectId,
undefined,
contentCacheName
);
assert.isString(response);
});
it('should delete content cache', async () => {
await deleteSample.generateContent(projectId, undefined, contentCacheName);
});
});