forked from FoundKeyGang/FoundKey
test - remove unneed async wrappings, drop GridFS drive_file correctly
This commit is contained in:
parent
fb422b4d60
commit
67d32b73f4
1 changed files with 12 additions and 11 deletions
23
test/api.js
23
test/api.js
|
@ -46,7 +46,8 @@ describe('API', () => {
|
||||||
beforeEach(() => Promise.all([
|
beforeEach(() => Promise.all([
|
||||||
db.get('users').drop(),
|
db.get('users').drop(),
|
||||||
db.get('posts').drop(),
|
db.get('posts').drop(),
|
||||||
db.get('drive_files').drop(),
|
db.get('drive_files.files').drop(),
|
||||||
|
db.get('drive_files.chunks').drop(),
|
||||||
db.get('drive_folders').drop(),
|
db.get('drive_folders').drop(),
|
||||||
db.get('apps').drop(),
|
db.get('apps').drop(),
|
||||||
db.get('access_tokens').drop(),
|
db.get('access_tokens').drop(),
|
||||||
|
@ -1131,8 +1132,8 @@ describe('API', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
async function insertSakurako(opts) {
|
function insertSakurako(opts) {
|
||||||
return await db.get('users').insert(Object.assign({
|
return db.get('users').insert(Object.assign({
|
||||||
token: '!00000000000000000000000000000000',
|
token: '!00000000000000000000000000000000',
|
||||||
username: 'sakurako',
|
username: 'sakurako',
|
||||||
username_lower: 'sakurako',
|
username_lower: 'sakurako',
|
||||||
|
@ -1141,8 +1142,8 @@ async function insertSakurako(opts) {
|
||||||
}, opts));
|
}, opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function insertHimawari(opts) {
|
function insertHimawari(opts) {
|
||||||
return await db.get('users').insert(Object.assign({
|
return db.get('users').insert(Object.assign({
|
||||||
token: '!00000000000000000000000000000001',
|
token: '!00000000000000000000000000000001',
|
||||||
username: 'himawari',
|
username: 'himawari',
|
||||||
username_lower: 'himawari',
|
username_lower: 'himawari',
|
||||||
|
@ -1151,8 +1152,8 @@ async function insertHimawari(opts) {
|
||||||
}, opts));
|
}, opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function insertDriveFile(opts) {
|
function insertDriveFile(opts) {
|
||||||
return await db.get('drive_files.files').insert({
|
return db.get('drive_files.files').insert({
|
||||||
length: opts.datasize,
|
length: opts.datasize,
|
||||||
metadata: Object.assign({
|
metadata: Object.assign({
|
||||||
name: 'strawberry-pasta.png'
|
name: 'strawberry-pasta.png'
|
||||||
|
@ -1160,15 +1161,15 @@ async function insertDriveFile(opts) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function insertDriveFolder(opts) {
|
function insertDriveFolder(opts) {
|
||||||
return await db.get('drive_folders').insert(Object.assign({
|
return db.get('drive_folders').insert(Object.assign({
|
||||||
name: 'my folder',
|
name: 'my folder',
|
||||||
parent_id: null
|
parent_id: null
|
||||||
}, opts));
|
}, opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function insertApp(opts) {
|
function insertApp(opts) {
|
||||||
return await db.get('apps').insert(Object.assign({
|
return db.get('apps').insert(Object.assign({
|
||||||
name: 'my app',
|
name: 'my app',
|
||||||
secret: 'mysecret'
|
secret: 'mysecret'
|
||||||
}, opts));
|
}, opts));
|
||||||
|
|
Loading…
Reference in a new issue