mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Tests for minifiers errors
This commit is contained in:
1
tools/tests/apps/minifier-plugin-bad-extension/.meteor/.gitignore
vendored
Normal file
1
tools/tests/apps/minifier-plugin-bad-extension/.meteor/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
local
|
||||
@@ -0,0 +1,7 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-platform
|
||||
local-plugin
|
||||
@@ -0,0 +1 @@
|
||||
none
|
||||
@@ -0,0 +1,5 @@
|
||||
Package.registerBuildPlugin({
|
||||
name: "bad-minifier",
|
||||
use: ['minifier-plugin'],
|
||||
sources: ['plugin.js']
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
Plugin.registerMinifier({
|
||||
extensions: ["foo"],
|
||||
}, function () {
|
||||
var minifier = new Minifier();
|
||||
return minifier;
|
||||
});
|
||||
|
||||
function Minifier () {};
|
||||
|
||||
Minifier.prototype.processFilesForTarget = function (files) { };
|
||||
|
||||
1
tools/tests/apps/minifier-plugin-multiple-minifiers-for-js/.meteor/.gitignore
vendored
Normal file
1
tools/tests/apps/minifier-plugin-multiple-minifiers-for-js/.meteor/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
local
|
||||
@@ -0,0 +1,7 @@
|
||||
# This file contains a token that is unique to your project.
|
||||
# Check it into your repository along with the rest of this directory.
|
||||
# It can be used for purposes such as:
|
||||
# - ensuring you don't accidentally deploy one app on top of another
|
||||
# - providing package authors with aggregated statistics
|
||||
|
||||
ogxdzy1on9lml15n20q5
|
||||
@@ -0,0 +1,8 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-platform
|
||||
local-plugin
|
||||
local-plugin-2
|
||||
@@ -0,0 +1,2 @@
|
||||
browser
|
||||
server
|
||||
@@ -0,0 +1 @@
|
||||
none
|
||||
@@ -0,0 +1,53 @@
|
||||
autoupdate@1.2.2
|
||||
base64@1.0.3
|
||||
binary-heap@1.0.3
|
||||
blaze@2.1.2
|
||||
blaze-tools@1.0.3
|
||||
boilerplate-generator@1.0.3
|
||||
callback-hook@1.0.3
|
||||
check@1.0.5
|
||||
ddp@1.2.0
|
||||
ddp-client@1.2.0
|
||||
ddp-common@1.2.0
|
||||
ddp-server@1.2.0
|
||||
deps@1.0.7
|
||||
ejson@1.0.6
|
||||
fastclick@1.0.6
|
||||
geojson-utils@1.0.3
|
||||
html-tools@1.0.4
|
||||
htmljs@1.0.4
|
||||
http@1.1.0
|
||||
id-map@1.0.3
|
||||
jquery@1.11.3_2
|
||||
json@1.0.3
|
||||
launch-screen@1.0.3
|
||||
livedata@1.0.13
|
||||
local-plugin@0.0.0
|
||||
local-plugin-2@0.0.0
|
||||
logging@1.0.8
|
||||
meteor@1.1.6
|
||||
meteor-platform@1.2.2
|
||||
minifier-plugin@1.0.0
|
||||
minifiers@1.1.5
|
||||
minimongo@1.0.8
|
||||
mobile-status-bar@1.0.4
|
||||
mongo@1.1.0
|
||||
npm-mongo@1.4.32_1
|
||||
observe-sequence@1.0.6
|
||||
ordered-dict@1.0.3
|
||||
random@1.0.3
|
||||
reactive-dict@1.1.0
|
||||
reactive-var@1.0.5
|
||||
reload@1.1.3
|
||||
retry@1.0.3
|
||||
routepolicy@1.0.5
|
||||
session@1.1.0
|
||||
spacebars@1.0.6
|
||||
spacebars-compiler@1.0.6
|
||||
templating@1.1.1
|
||||
tracker@1.0.7
|
||||
ui@1.0.6
|
||||
underscore@1.0.3
|
||||
url@1.0.4
|
||||
webapp@1.2.1
|
||||
webapp-hashing@1.0.3
|
||||
@@ -0,0 +1,5 @@
|
||||
Package.registerBuildPlugin({
|
||||
name: "bad-minifier-2",
|
||||
use: ['minifier-plugin'],
|
||||
sources: ['plugin.js']
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
Plugin.registerMinifier({
|
||||
extensions: ["js"],
|
||||
}, function () {
|
||||
var minifier = new Minifier();
|
||||
return minifier;
|
||||
});
|
||||
|
||||
function Minifier () {};
|
||||
|
||||
Minifier.prototype.processFilesForTarget = function (files) { };
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Package.registerBuildPlugin({
|
||||
name: "bad-minifier",
|
||||
use: ['minifier-plugin'],
|
||||
sources: ['plugin.js']
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
Plugin.registerMinifier({
|
||||
extensions: ["js"],
|
||||
}, function () {
|
||||
var minifier = new Minifier();
|
||||
return minifier;
|
||||
});
|
||||
|
||||
function Minifier () {};
|
||||
|
||||
Minifier.prototype.processFilesForTarget = function (files) { };
|
||||
|
||||
27
tools/tests/minifier-bad-plugins.js
Normal file
27
tools/tests/minifier-bad-plugins.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var selftest = require('../selftest.js');
|
||||
var Sandbox = selftest.Sandbox;
|
||||
|
||||
selftest.define("minifiers can't register non-js/non-css extensions", [], function () {
|
||||
var s = new Sandbox();
|
||||
var run;
|
||||
|
||||
s.createApp("myapp", "minifier-plugin-bad-extension", { dontPrepareApp: true });
|
||||
s.cd("myapp");
|
||||
|
||||
run = s.run();
|
||||
run.match("foo: Minifiers are only allowed to register \"css\" or \"js\" extensions.");
|
||||
run.stop();
|
||||
});
|
||||
|
||||
selftest.define("minifiers: apps can't use more than one package providing a minifier for the same extension", [], function () {
|
||||
var s = new Sandbox();
|
||||
var run;
|
||||
|
||||
s.createApp("myapp", "minifier-plugin-multiple-minifiers-for-js", { dontPrepareApp: true });
|
||||
s.cd("myapp");
|
||||
|
||||
run = s.run("--production");
|
||||
run.match("local-plugin, local-plugin-2: multiple packages registered minifiers for extension \"js\".");
|
||||
run.stop();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user