Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*
- run: npm i
- run: npm run lint

Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16, 18]
node_version: [20, 22, 24]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@master
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: lts/*
- run: npm i
- run: npx bower install
- run: npm run test:browser
Expand All @@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*
- run: npm i
- name: Release
env:
Expand Down
25 changes: 15 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import buffer from 'vinyl-buffer';
import source from 'vinyl-source-stream';
import sourcemaps from 'gulp-sourcemaps';
import util from 'gulp-util';
import glob from 'glob';
import {glob} from 'glob';
import localhost from 'localhost';

const port = 8080;
Expand All @@ -22,22 +22,27 @@ gulp.task('localhost', done => {
util.log('Listening on port', util.colors.cyan(port));
});

gulp.task('index_tests', () => {
gulp.task('index_tests', async () => {

const root = 'test/specs/';

util.log(`${util.colors.cyan('index_tests')}`);

// for the given files in the test directory, create an index
return glob('test/specs/**/*.spec.js', (err, files) => {
let files = await glob('test/specs/**/*.spec.js');

files = files.filter(path => path !== '!test/specs/index.js');

files = files.filter(path => path !== '!test/specs/index.js');
// Sort the files to ensure consistent order
files.sort();

// Write line to the index file
const index = files.map(name => `import('${name.replace(root, './')}');`);
// Write line to the index file
const index = files.map(name => `import('${name.replace(root, './')}');`);

index.push('');
index.push('');

fs.writeFileSync('test/specs/index.js', index.join('\n'));
});
fs.writeFileSync('test/specs/index.js', index.join('\n'));
util.log(`Wrote ${util.colors.cyan('test/specs/index.js')} with ${files.length} tests`);
});

gulp.task('watch', gulp.series('localhost', () => gulp.watch(scripts_to_watch, {interval: 500}, ['test'])));
Expand All @@ -64,7 +69,7 @@ gulp.task('test', gulp.series('bundle', testSpecs('test/bundle.html')));

gulp.task('watch_bundle', () => gulp.watch(scripts_to_watch, {interval: 500}, ['bundle']));

gulp.task('default', gulp.series('localhost', 'test', done => {
gulp.task('default', gulp.series('localhost', 'bundle', done => {
util.log(`Closing localhost:${port}`);
server.close(done);
}));
Expand Down
Loading