-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Um teste unitário, para o diretório não ficar vazio.
- Loading branch information
1 parent
6685171
commit 2beb32e
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as sistemaArquivos from 'fs'; | ||
import * as caminho from 'path'; | ||
import {expect, jest, test} from '@jest/globals'; | ||
|
||
import { NucleoExecucao } from '../fontes/nucleo-execucao'; | ||
|
||
jest.mock('sistemaArquivos'); | ||
jest.mock('path'); | ||
|
||
describe('Núcleo de execução', () => { | ||
it('`executarCodigoComoArgumento`, trivial', async () => { | ||
let retornoSaida: string = ''; | ||
const funcaoDeRetorno = (saida: string) => retornoSaida = saida; | ||
const nucleoExecucao = new NucleoExecucao(funcaoDeRetorno); | ||
nucleoExecucao.configurarDialeto(); | ||
await nucleoExecucao.executarCodigoComoArgumento('escreva("Olá mundo!")'); | ||
|
||
expect(retornoSaida).toBe('Olá mundo!'); | ||
}); | ||
}); |