Skip to content

Commit

Permalink
Fixing tests and making this into a GHA pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjoeyyong committed Jan 22, 2025
1 parent b00a257 commit e55b860
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 0.10
node-version: 20.18.1

# Install grunt-cli globally
- name: Install grunt-cli
Expand All @@ -34,4 +34,4 @@ jobs:

# Run tests
- name: Run tests
run: npm test
run: grunt ci
18 changes: 13 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
module.exports = function(grunt) {
require('load-grunt-config')(grunt)
// load npm tasks
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-karma-coveralls')
}
// Load grunt configurations
require('load-grunt-config')(grunt, {
configPath: require('path').join(__dirname, 'grunt'),
init: true,
});

// Load npm tasks
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');

// Default task
grunt.registerTask('test', ['karma:chrome']);
};
4 changes: 2 additions & 2 deletions grunt/aliases.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
'test': [
'karma:phantom',
'karma:chrome',

Check warning on line 3 in grunt/aliases.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
],

'sauce': [
Expand All @@ -13,7 +13,7 @@ module.exports = {
'eslint',
'clean:coverage',
'karma:coverage',
'coveralls',
// 'coveralls', //doesn't seem to be a thing anymore.
//'sauce', TODO: investigate why sauce connect isnt working
],
}
24 changes: 13 additions & 11 deletions grunt/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,24 @@ module.exports = {
},
},

phantom: {
frameworks: ['jasmine', 'es5-shim'],
browsers: ['PhantomJS'],
},

chrome: {
reporters: ['html'],
browsers: ['Chrome'],
autoWatch: true,
singleRun: false,
frameworks: ['jasmine'],
reporters: ['progress', 'html'],
browsers: ['ChromeHeadless'], // Use ChromeHeadless instead of Chrome or PhantomJS
customLaunchers: {
HeadlessChrome: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--disable-gpu'], // Required for CI environments
},
},
autoWatch: false,
singleRun: true,
},

coverage: {
frameworks: ['jasmine', 'es5-shim'],
frameworks: ['jasmine'],
reporters: ['progress', 'coverage'],
browsers: ['PhantomJS'],
browsers: ['ChromeHeadless'],
coverageReporter: {
reporters: [
{ type: 'html', dir: 'coverage/' },
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@
"jstransform": "^11.0.1",
"jstransform-loader": "^0.2.0",
"karma": "^0.13.3",
"karma-chrome-launcher": "^0.2.0",
"karma-chrome-launcher": "^0.2.3",
"karma-coverage": "^0.4.2",
"karma-es5-shim": "https://github.com/pokehanai/karma-es5-shim/archive/v2.1.0.tar.gz",
"karma-jasmine": "^0.3.6",
"karma-jasmine-html-reporter": "^0.1.8",
"karma-phantomjs-launcher": "^0.2.0",
"karma-sauce-launcher": "^0.2.14",
"karma-webpack": "^1.7.0",
"load-grunt-config": "^0.17.1",
"lodash": "^4.17.11",
"node-libs-browser": "^0.5.2",
"phantomjs": "^1.9.17",
"puppeteer": "^24.1.0",
"react": "^0.13.3",
"webpack": "^1.10.5"
}
Expand Down

0 comments on commit e55b860

Please sign in to comment.