Skip to content

Commit b70c1d9

Browse files
authored
Update tests and dependencies (#230)
* Update tests * Update deps * Switch to Github Actions * Use npx
1 parent 5759edd commit b70c1d9

File tree

12 files changed

+6233
-3115
lines changed

12 files changed

+6233
-3115
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
env:
4+
CI: true
5+
6+
jobs:
7+
run:
8+
name: Node ${{ matrix.node }} on ${{ matrix.os }}
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
node: [10, 12, 14]
15+
os: [ubuntu-latest, windows-latest]
16+
17+
steps:
18+
- name: Clone repository
19+
uses: actions/checkout@v2
20+
21+
- name: Set Node.js version
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node }}
25+
26+
- name: Install npm dependencies
27+
run: npm ci
28+
29+
- name: Run tests
30+
run: npm test
31+
32+
# We test multiple Windows shells because of prior stdout buffering issues
33+
# filed against Grunt. https://github.com/joyent/node/issues/3584
34+
- name: Run PowerShell tests
35+
run: "npm test # PowerShell" # Pass comment to PS for easier debugging
36+
shell: powershell
37+
if: startsWith(matrix.os, 'windows')

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"node": true,
1111
"sub": true,
1212
"undef": true,
13-
"unused": true
13+
"unused": true,
14+
"esversion": 6
1415
}

.travis.yml

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

Gruntfile.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function(grunt) {
1616
all: [
1717
'Gruntfile.js',
1818
'tasks/*.js',
19-
'<%= nodeunit.tests %>'
19+
'tests/*.js'
2020
],
2121
options: {
2222
jshintrc: '.jshintrc'
@@ -239,8 +239,10 @@ module.exports = function(grunt) {
239239
},
240240

241241
// Unit tests.
242-
nodeunit: {
243-
tests: ['test/*_test.js']
242+
run: {
243+
jest: {
244+
exec: 'npx jest',
245+
}
244246
}
245247
});
246248

@@ -253,10 +255,11 @@ module.exports = function(grunt) {
253255
grunt.loadNpmTasks('grunt-contrib-copy');
254256
grunt.loadNpmTasks('grunt-contrib-nodeunit');
255257
grunt.loadNpmTasks('grunt-contrib-internal');
258+
grunt.loadNpmTasks('grunt-run');
256259

257260
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
258261
// plugin's task(s), then test the result.
259-
grunt.registerTask('test', ['jshint', 'clean', 'copy', 'compress', 'nodeunit']);
262+
grunt.registerTask('test', ['jshint', 'clean', 'copy', 'compress', 'run:jest']);
260263

261264
// By default, lint and run all tests.
262265
grunt.registerTask('default', ['test', 'contrib-ci:skipIfExists', 'build-contrib']);

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# grunt-contrib-compress v1.6.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-compress.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-compress) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/tiwbi1smm1j8aa5j/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-compress/branch/master)
1+
# grunt-contrib-compress v2.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-compress/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-compress/actions?workflow=Tests)
22

33
> Compress files and folders
44
@@ -329,4 +329,4 @@ compress: {
329329

330330
Task submitted by [Chris Talkington](http://christalkington.com/)
331331

332-
*This file was generated on Mon Oct 21 2019 10:25:59.*
332+
*This file was generated on Sat Dec 12 2020 13:29:16.*

appveyor.yml

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

0 commit comments

Comments
 (0)