Skip to content

Commit

Permalink
remove redundant tests & enhance existing
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Aug 1, 2023
1 parent abe6149 commit cf9dcc8
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 42 deletions.
2 changes: 2 additions & 0 deletions test/commands/help-test.js
@@ -1,3 +1,5 @@
process.env['FORCE_COLOR'] = 0;

import { module, test } from 'qunitx';
import process from "node:process";
import fs from 'node:fs';
Expand Down
5 changes: 0 additions & 5 deletions test/flags/failfast-test.js

This file was deleted.

6 changes: 0 additions & 6 deletions test/flags/reporter-test.js

This file was deleted.

35 changes: 20 additions & 15 deletions test/helpers/failing-tests.ts
@@ -1,6 +1,10 @@
import { module, test } from 'qunitx';

module('{{moduleName}} Failing Tests', function(hooks) {
interface Person {
name: String;
}

module('{{moduleName}} Failing Tests', function (hooks) {
test('assert true works', function (assert) {
assert.expect(3);
assert.ok(true);
Expand All @@ -12,20 +16,21 @@ module('{{moduleName}} Failing Tests', function(hooks) {
test('async test finishes', async function (assert) {
assert.expect(4);

const wait = () => new Promise((resolve, reject) => {
window.setTimeout(() => {
console.log('resolving async test');
console.log({
moduleName: 'called resolved async test with object',
placeholder: 1000,
anotherObject: {
firstName: 'Izel',
createdAt: new Date('2021-03-06')
}
});
resolve(true);
}, 50);
});
const wait = () =>
new Promise((resolve, reject) => {
window.setTimeout(() => {
console.log('resolving async test');
console.log({
moduleName: 'called resolved async test with object',
placeholder: 1000,
anotherObject: {
firstName: 'Izel',
createdAt: new Date('2021-03-06'),
},
});
resolve(true);
}, 50);
});
const result = await wait();

assert.ok(true);
Expand Down
12 changes: 8 additions & 4 deletions test/helpers/passing-tests.ts
@@ -1,6 +1,10 @@
import { module, test } from 'qunitx';

module('{{moduleName}} Passing Tests', function(hooks) {
interface Person {
name: String;
}

module('{{moduleName}} Passing Tests', function (hooks) {
test('assert true works', function (assert) {
assert.expect(3);
assert.ok(true);
Expand All @@ -20,10 +24,10 @@ module('{{moduleName}} Passing Tests', function(hooks) {
placeholder: 1000,
anotherObject: {
firstName: 'Izel',
createdAt: new Date('2021-03-06')
}
createdAt: new Date('2021-03-06'),
},
});
resolve(true)
resolve(true);
}, 50);
});
const result = await wait;
Expand Down
11 changes: 0 additions & 11 deletions test/inputs/file-and-folder-test.js

This file was deleted.

1 change: 1 addition & 0 deletions test/inputs/file-test.js
@@ -1,4 +1,5 @@
import { module, test } from 'qunitx';
import '../setup.js';
import { assertPassingTestCase, assertFailingTestCase, assertTAPResult } from '../helpers/assert-stdout.js';
import shell from '../helpers/shell.js';

Expand Down
1 change: 1 addition & 0 deletions test/inputs/folder-test.js
@@ -1,4 +1,5 @@
import { module, test } from 'qunitx';
import '../setup.js';
import { writeTestFolder } from '../helpers/fs-writers.js';
import { assertPassingTestCase, assertFailingTestCase, assertTAPResult } from '../helpers/assert-stdout.js';
import shell from '../helpers/shell.js';
Expand Down
1 change: 0 additions & 1 deletion test/inputs/index.js
@@ -1,5 +1,4 @@
import "./advanced-htmls-test.js";
import "./error-edge-cases-test.js";
import "./file-and-folder-test.js";
import "./file-test.js";
import "./folder-test.js";

0 comments on commit cf9dcc8

Please sign in to comment.