Merge pull request #121 from SELab-2/fix/tests-werken-niet-op-dev
fix: Tests falen op `dev`
This commit is contained in:
		
						commit
						9029d93e30
					
				
					 4 changed files with 11 additions and 5 deletions
				
			
		
							
								
								
									
										3
									
								
								backend/.env.test
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								backend/.env.test
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | ||||||
|  | PORT=3000 | ||||||
|  | DWENGO_DB_UPDATE=true | ||||||
|  | DWENGO_DB_NAME=":memory:" | ||||||
|  | @ -60,7 +60,8 @@ describe('DatabaseLearningObjectProvider', () => { | ||||||
|     describe('getLearningObjectHTML', () => { |     describe('getLearningObjectHTML', () => { | ||||||
|         it('should return the correct rendering of the learning object', async () => { |         it('should return the correct rendering of the learning object', async () => { | ||||||
|             const result = await databaseLearningObjectProvider.getLearningObjectHTML(exampleLearningObject); |             const result = await databaseLearningObjectProvider.getLearningObjectHTML(exampleLearningObject); | ||||||
|             expect(result).toEqual(example.getHTMLRendering()); |             // Set newlines so your tests are platform-independent.
 | ||||||
|  |             expect(result).toEqual(example.getHTMLRendering().replace(/\r\n/g, '\n')); | ||||||
|         }); |         }); | ||||||
|         it('should return null for a non-existing learning object', async () => { |         it('should return null for a non-existing learning object', async () => { | ||||||
|             const result = await databaseLearningObjectProvider.getLearningObjectHTML({ |             const result = await databaseLearningObjectProvider.getLearningObjectHTML({ | ||||||
|  |  | ||||||
|  | @ -68,7 +68,8 @@ describe('LearningObjectService', () => { | ||||||
|         it('returns the expected HTML when queried with the identifier of a learning object saved in the database', async () => { |         it('returns the expected HTML when queried with the identifier of a learning object saved in the database', async () => { | ||||||
|             const result = await learningObjectService.getLearningObjectHTML(exampleLearningObject); |             const result = await learningObjectService.getLearningObjectHTML(exampleLearningObject); | ||||||
|             expect(result).not.toBeNull(); |             expect(result).not.toBeNull(); | ||||||
|             expect(result).toEqual(learningObjectExample.getHTMLRendering()); |             // Set newlines so your tests are platform-independent.
 | ||||||
|  |             expect(result).toEqual(learningObjectExample.getHTMLRendering().replace(/\r\n/g, '\n')); | ||||||
|         }); |         }); | ||||||
|         it( |         it( | ||||||
|             'returns the same HTML as the Dwengo API when queried with the identifier of a learning object that does ' + |             'returns the same HTML as the Dwengo API when queried with the identifier of a learning object that does ' + | ||||||
|  |  | ||||||
|  | @ -8,18 +8,19 @@ describe('ProcessingService', () => { | ||||||
|     it('renders a markdown learning object correctly', async () => { |     it('renders a markdown learning object correctly', async () => { | ||||||
|         const markdownLearningObject = mdExample.createLearningObject(); |         const markdownLearningObject = mdExample.createLearningObject(); | ||||||
|         const result = await processingService.render(markdownLearningObject); |         const result = await processingService.render(markdownLearningObject); | ||||||
|         expect(result).toEqual(mdExample.getHTMLRendering()); |         // Set newlines so your tests are platform-independent.
 | ||||||
|  |         expect(result).toEqual(mdExample.getHTMLRendering().replace(/\r\n/g, '\n')); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('renders a multiple choice question correctly', async () => { |     it('renders a multiple choice question correctly', async () => { | ||||||
|         const multipleChoiceLearningObject = multipleChoiceExample.createLearningObject(); |         const multipleChoiceLearningObject = multipleChoiceExample.createLearningObject(); | ||||||
|         const result = await processingService.render(multipleChoiceLearningObject); |         const result = await processingService.render(multipleChoiceLearningObject); | ||||||
|         expect(result).toEqual(multipleChoiceExample.getHTMLRendering()); |         expect(result).toEqual(multipleChoiceExample.getHTMLRendering().replace(/\r\n/g, '\n')); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     it('renders an essay question correctly', async () => { |     it('renders an essay question correctly', async () => { | ||||||
|         const essayLearningObject = essayExample.createLearningObject(); |         const essayLearningObject = essayExample.createLearningObject(); | ||||||
|         const result = await processingService.render(essayLearningObject); |         const result = await processingService.render(essayLearningObject); | ||||||
|         expect(result).toEqual(essayExample.getHTMLRendering()); |         expect(result).toEqual(essayExample.getHTMLRendering().replace(/\r\n/g, '\n')); | ||||||
|     }); |     }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Laure Jablonski
						Laure Jablonski