Skip to content

Commit

Permalink
POC definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
ngarbezza committed Nov 4, 2024
1 parent 78a7cd0 commit 6558d73
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/core/test_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class TestRunner {
#failFastMode;
#randomOrder;
#testExecutionTimeoutMs;
#archivoActual;

constructor(callbacks) {
this.#suites = [];
Expand All @@ -25,7 +26,7 @@ export class TestRunner {
// Configuration

registerSuite(name, suiteBody, callbacks) {
const suiteToAdd = new TestSuite(name, suiteBody, callbacks);
const suiteToAdd = new TestSuite(name, suiteBody, callbacks, this.#archivoActual);
return this.addSuite(suiteToAdd);
}

Expand Down Expand Up @@ -139,4 +140,9 @@ export class TestRunner {
return this.#callbacks.onSuccess(this);
}
}

cargandoArchivo(file) {
console.log(`Cargando archivo: ${file}`);

Check failure on line 145 in lib/core/test_runner.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected console statement

Check failure on line 145 in lib/core/test_runner.js

View workflow job for this annotation

GitHub Actions / build (18.x)

'console' is not defined

Check failure on line 145 in lib/core/test_runner.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected console statement

Check failure on line 145 in lib/core/test_runner.js

View workflow job for this annotation

GitHub Actions / build (20.x)

'console' is not defined

Check failure on line 145 in lib/core/test_runner.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement

Check failure on line 145 in lib/core/test_runner.js

View workflow job for this annotation

GitHub Actions / build (22.x)

'console' is not defined
this.#archivoActual = file;
}
}
6 changes: 5 additions & 1 deletion lib/core/test_suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ export class TestSuite {

// Instance creation

constructor(name, body, callbacks) {
// TODO: ajustar la regla de eslint para que max-params permita 6 parámetros

Check failure on line 41 in lib/core/test_suite.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected 'todo' comment: 'TODO: ajustar la regla de eslint para...'

Check failure on line 41 in lib/core/test_suite.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected 'todo' comment: 'TODO: ajustar la regla de eslint para...'

Check failure on line 41 in lib/core/test_suite.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected 'todo' comment: 'TODO: ajustar la regla de eslint para...'
// eslint-disable-next-line max-params
constructor(name, body, callbacks, definition) {
this.#initializeName(name);
this.#initializeBody(body);
this.#tests = [];
this.#callbacks = callbacks;
this.#before = undefined;
this.#after = undefined;
this.#isSkipped = false;
// TODO: hacer privado

Check failure on line 51 in lib/core/test_suite.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected 'todo' comment: 'TODO: hacer privado'

Check failure on line 51 in lib/core/test_suite.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected 'todo' comment: 'TODO: hacer privado'

Check failure on line 51 in lib/core/test_suite.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected 'todo' comment: 'TODO: hacer privado'
this.definition = definition;
}

// Initializing / Configuring
Expand Down
3 changes: 3 additions & 0 deletions lib/testy.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class Testy {

async #loadFileHandlingErrors(file) {
try {
// OJO: este approach solo funciona porque estamos cargando los archivos en secuencia.
// TODO: crear una ADR para documentar esta decisión.

Check failure on line 182 in lib/testy.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected 'todo' comment: 'TODO: crear una ADR para documentar esta...'

Check failure on line 182 in lib/testy.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected 'todo' comment: 'TODO: crear una ADR para documentar esta...'

Check failure on line 182 in lib/testy.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected 'todo' comment: 'TODO: crear una ADR para documentar esta...'
testRunner.cargandoArchivo(file);
await import(file);
} catch (err) {
ui.exitWithError(
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export class Formatter {
displaySuiteEnd(suite) {
this.#displaySeparator('-');
this.#console.log(`${this.#translated('summary_of')} ${suite.name()}:`);
// TODO: internacionalizar mensaje

Check failure on line 58 in lib/ui/formatter.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected 'todo' comment: 'TODO: internacionalizar mensaje'

Check failure on line 58 in lib/ui/formatter.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected 'todo' comment: 'TODO: internacionalizar mensaje'

Check failure on line 58 in lib/ui/formatter.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected 'todo' comment: 'TODO: internacionalizar mensaje'
// TODO: testear que se muestre la definición

Check failure on line 59 in lib/ui/formatter.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected 'todo' comment: 'TODO: testear que se muestre la...'

Check failure on line 59 in lib/ui/formatter.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected 'todo' comment: 'TODO: testear que se muestre la...'

Check failure on line 59 in lib/ui/formatter.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected 'todo' comment: 'TODO: testear que se muestre la...'
this.#console.log(`Defined in: ${suite.definition}`);
this.#displayCountFor(suite);
this.#displaySeparator();
}
Expand Down

0 comments on commit 6558d73

Please sign in to comment.