Skip to content

Commit 831a43f

Browse files
committed
chore(tests): use glob to find tests
Instead of manually managing tests in a single `tests.js` file, globbing increases discoverability of tests.
1 parent 53170d2 commit 831a43f

File tree

3 files changed

+10
-103
lines changed

3 files changed

+10
-103
lines changed

Sources/Testing/setupTestEnv.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import test from 'tape-catch';
22

3+
// Load default classes for tests
4+
import '../IO/Core/DataAccessHelper/HtmlDataAccessHelper';
5+
import '../IO/Core/DataAccessHelper/HttpDataAccessHelper';
6+
import '../IO/Core/DataAccessHelper/JSZipDataAccessHelper';
7+
8+
// Load the rendering pieces we want to use (for both WebGL and WebGPU)
9+
import '../Rendering/Profiles/All';
10+
311
/**
412
* Buffers written objects until a reader attaches,
513
* after which all writes go to the reader.

Sources/tests.js

Lines changed: 0 additions & 101 deletions
This file was deleted.

karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ module.exports = function init(config) {
2424
basePath: '',
2525
frameworks: ['tape-object-stream', 'webpack'],
2626
files: [
27-
'Sources/tests.js',
2827
'Sources/Testing/setupTestEnv.js',
28+
'Sources/**/test*.js',
2929
{ pattern: 'Data/**', watched: false, served: true, included: false },
3030
],
3131

3232
preprocessors: {
33-
'Sources/tests.js': ['webpack'],
3433
'Sources/Testing/setupTestEnv.js': ['webpack'],
34+
'Sources/**/test*.js': ['webpack'],
3535
},
3636

3737
webpack: {

0 commit comments

Comments
 (0)