Skip to content

Commit

Permalink
Um teste unitário, para o diretório não ficar vazio.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonelsanchesdasilva committed Aug 19, 2023
1 parent 6685171 commit 2beb32e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions testes/nucleo-execucao.test.ts
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!');
});
});

0 comments on commit 2beb32e

Please sign in to comment.