mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 18:46:01 +01:00 
			
		
		
		
	feat: #8550, add upgrade script test
flush test db after tests are complete
This commit is contained in:
		| @@ -105,6 +105,10 @@ winston.info('environment ' + global.env); | ||||
| const db = require('../../src/database'); | ||||
| module.exports = db; | ||||
|  | ||||
| after(async function () { | ||||
| 	await db.flushdb(); | ||||
| }); | ||||
|  | ||||
| before(async function () { | ||||
| 	this.timeout(30000); | ||||
| 	await db.init(); | ||||
|   | ||||
							
								
								
									
										13
									
								
								test/upgrade.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								test/upgrade.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| 'use strict'; | ||||
|  | ||||
| const assert = require('assert'); | ||||
|  | ||||
| const db = require('./mocks/databasemock'); | ||||
| const upgrade = require('../src/upgrade'); | ||||
|  | ||||
| describe('Upgrade', function () { | ||||
| 	it('should get all upgrade scripts', async function () { | ||||
| 		const files = await upgrade.getAll(); | ||||
| 		assert(Array.isArray(files) && files.length > 0); | ||||
| 	}); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user