generated from actions/javascript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.test.js
More file actions
17 lines (13 loc) · 534 Bytes
/
index.test.js
File metadata and controls
17 lines (13 loc) · 534 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const uploader = require('./uploader');
require('dotenv').config();
const cloudName = process.env.CLOUDINARY_CLOUD_NAME;
const apiKey = process.env.CLOUDINARY_API_KEY;
const apiSecret = process.env.CLOUDINARY_API_SECRET;
test('upload empty array', () => {
const files = [];
expect(uploader(cloudName, apiKey, apiSecret, files)).resolves.toStrictEqual([]);
});
test('upload one image', () => {
const files = ['./medias/images/test1.jpg'];
expect(uploader(cloudName, apiKey, apiSecret, files)).resolves.toHaveLength(1);
});