Skip to content

Commit

Permalink
Merge pull request #194 from Mr0grog/191-shed-some-vestigial-stuff
Browse files Browse the repository at this point in the history
Shed some vestigial dev tooling
  • Loading branch information
pimterry authored Jan 17, 2024
2 parents 1f67f49 + d97ef5d commit 9c99ede
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 626 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Before submitting a pull request to fix a bug or add a new feature, please check

To be more specific, before submitting your pull request please ensure:

* You haven't broken the existing test suite in any obvious browsers (at least check latest IE/FF/Chrome - automatic saucelabs tests for this are coming soon too)
* You haven't broken the existing test suite in any obvious browsers (at least check latest IE/FF/Chrome)
* You've added relevant tests for the bug you're fixing/the new feature you're adding/etc, which pass in all the relevant browsers
* JSHint is happy with your new code
* You've updated the API docs (in README.md) to detail any changes you've made to the public interface
Expand Down
75 changes: 12 additions & 63 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

module.exports = function (grunt) {
var jasmineRequireJsOptions = {
specs: 'test/*-test.js',
helpers: 'test/*-helper.js',
};

// Project configuration.
grunt.initConfig({
Expand Down Expand Up @@ -34,32 +38,30 @@ module.exports = function (grunt) {
requirejs: {
src: [],
options: {
specs: 'test/*-test.js',
vendor: 'test/vendor/*.js',
helpers: 'test/*-helper.js',
specs: jasmineRequireJsOptions.specs,
helpers: jasmineRequireJsOptions.helpers,
template: require('./vendor/grunt-template-jasmine-requirejs')
}
},
global: {
src: 'lib/**/*.js',
options: {
specs: 'test/global-integration.js',
vendor: 'test/vendor/*.js'
}
},
context: {
src: 'test/test-context-using-apply.generated.js',
options: {
specs: 'test/global-integration-with-new-context.js',
vendor: 'test/vendor/*.js'
}
},
// Wraps the `requirejs` configuration above with Instanbul code
// coverage tracking.
withCoverage: {
src: 'lib/**/*.js',
options: {
specs: 'test/*-test.js',
vendor: 'test/vendor/*.js',
helpers: 'test/*-helper.js',
specs: jasmineRequireJsOptions.specs,
helpers: jasmineRequireJsOptions.helpers,
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/coverage.json',
Expand All @@ -78,14 +80,7 @@ module.exports = function (grunt) {
}
],

template: require('./vendor/grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
paths: {
"lib": '.grunt/grunt-contrib-jasmine/lib/'
}
}
}
template: require('./vendor/grunt-template-jasmine-requirejs')
}
}
}
Expand All @@ -100,9 +95,6 @@ module.exports = function (grunt) {
}
}
},
coveralls: {
src: 'coverage/lcov.info'
},
open: {
jasmine: {
path: 'http://127.0.0.1:8000/_SpecRunner.html'
Expand All @@ -114,39 +106,6 @@ module.exports = function (grunt) {
keepalive: true
}
},
'saucelabs-jasmine': {
// Requires valid SAUCE_USERNAME and SAUCE_ACCESS_KEY in env to run.
all: {
options: {
urls: ['http://localhost:8000/_SpecRunner.html'],
browsers: [
{"browserName": "firefox", "platform": "Windows 2003", "version": "3.6"},
{"browserName": "firefox", "platform": "Windows 2003", "version": "4"},
{"browserName": "firefox", "platform": "Windows 2003", "version": "25"},
{"browserName": "safari", "platform": "Mac 10.6", "version": "5"},
{"browserName": "safari", "platform": "Mac 10.8", "version": "6"},
{"browserName": "googlechrome", "platform": "Windows 7"},
{"browserName": "opera", "platform": "Windows 2003", "version": "12"},
// Disabled because old IE breaks the Jasmine runner; these have to be manually tested
// {"browserName": "iehta", "platform": "Windows XP", "version": "6"},
// {"browserName": "iehta", "platform": "Windows XP", "version": "7"},
// {"browserName": "iehta", "platform": "Windows XP", "version": "8"},
{"browserName": "iehta", "platform": "Windows 7", "version": "9"},
{"browserName": "iehta", "platform": "Windows 7", "version": "10"},
{"browserName": "opera", "platform": "Windows 7", "version": "12"},
{"browserName": "android", "platform": "Linux", "version": "4.0"},
{"browserName": "iphone", "platform": "OS X 10.8", "version": "6"}
],
concurrency: 3,
detailedError: true,
testTimeout:10000,
testInterval:1000,
testReadyTimeout:2000,
testname: 'loglevel jasmine test',
tags: [process.env.TRAVIS_REPO_SLUG || "local", process.env.TRAVIS_COMMIT || "manual"]
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
Expand Down Expand Up @@ -181,9 +140,6 @@ module.exports = function (grunt) {
tasks: ['jshint:test', 'test']
}
},
qunit: {
all: ['test/*-qunit.html']
},
preprocess: {
"test-context-using-apply": {
src: 'test/test-context-using-apply.js',
Expand All @@ -199,15 +155,12 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-qunit');

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-preprocess');
grunt.loadNpmTasks('grunt-contrib-clean');

Expand All @@ -217,17 +170,13 @@ module.exports = function (grunt) {

// Check everything is good
grunt.registerTask('test', ['jshint', 'test-browser', 'test-node']);
grunt.registerTask('test-browser', ['jasmine:requirejs', 'jasmine:global', 'preprocess', 'jasmine:context', 'clean:test', 'jasmine:withCoverage', 'qunit']);
grunt.registerTask('test-browser', ['jasmine:global', 'preprocess', 'jasmine:context', 'clean:test', 'jasmine:withCoverage']);
grunt.registerTask('test-node', ['jasmine_node']);

// Test with a live server and an actual browser
grunt.registerTask('integration-test', ['jasmine:requirejs:src:build', 'open:jasmine', 'connect:test:keepalive']);

// Test with lots of browsers on saucelabs. Requires valid SAUCE_USERNAME and SAUCE_ACCESS_KEY in env to run.
grunt.registerTask('saucelabs', ['jasmine:requirejs:src:build', 'connect:test', 'saucelabs-jasmine']);

// Default task.
grunt.registerTask('default', 'test');
grunt.registerTask('ci', ['test', 'coveralls']);

};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# loglevel [![NPM version][npm-image]][npm-url] [![NPM downloads](https://img.shields.io/npm/dw/loglevel.svg)](https://www.npmjs.com/package/loglevel) [![Build status](https://travis-ci.org/pimterry/loglevel.png)](https://travis-ci.org/pimterry/loglevel) [![Coveralls percentage](https://img.shields.io/coveralls/pimterry/loglevel.svg)](https://coveralls.io/r/pimterry/loglevel?branch=master)
# loglevel [![NPM version][npm-image]][npm-url] [![NPM downloads](https://img.shields.io/npm/dw/loglevel.svg)](https://www.npmjs.com/package/loglevel) [![Build status](https://travis-ci.org/pimterry/loglevel.png)](https://travis-ci.org/pimterry/loglevel)

[npm-image]: https://img.shields.io/npm/v/loglevel.svg?style=flat
[npm-url]: https://npmjs.org/package/loglevel
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"test-browser": "grunt test-browser",
"test-node": "grunt test-node",
"test-types": "tsc --noEmit ./test/type-test.ts",
"ci": "grunt ci",
"dist": "grunt dist",
"dist-build": "grunt dist-build",
"watch": "grunt watch"
Expand All @@ -47,16 +46,12 @@
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-jasmine": "~1.0.3",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-qunit": "^2.0.0",
"grunt-contrib-uglify": "^3.4.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-coveralls": "^1.0.0",
"grunt-jasmine-node": "~0.2.1",
"grunt-open": "~0.2.3",
"grunt-preprocess": "^5.1.0",
"grunt-saucelabs": "^8.2.0",
"grunt-template-jasmine-istanbul": "~0.4.0",
"qunitjs": "1.14.0",
"typescript": "^3.5.1"
},
"keywords": [
Expand Down
18 changes: 18 additions & 0 deletions test/global-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,22 @@ describe("loglevel from a global <script> tag", function () {

expect(console.log).toHaveBeenCalledWith("test message");
});

describe("noConflict()", function () {
var globalLog;

beforeEach(function () {
globalLog = window.log;
});

afterEach(function () {
window.log = globalLog;
});

it("removes global reference to `log`", function () {
var local = log.noConflict();
expect(window.log).toBeUndefined();
expect(local).toEqual(globalLog);
});
});
});
19 changes: 0 additions & 19 deletions test/test-qunit.html

This file was deleted.

51 changes: 0 additions & 51 deletions test/test-qunit.js

This file was deleted.

Loading

0 comments on commit 9c99ede

Please sign in to comment.