Skip to content

Commit

Permalink
Skip plugin tests when plugins can't be unregistered.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Jun 26, 2019
1 parent 97c6406 commit bc85143
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TemplateCompiler extends Filter {

this.precompile = this.options.templateCompiler.precompile;
this.registerPlugin = this.options.templateCompiler.registerPlugin;
this.unregisterPlugin = this.options.templateCompiler.removePlugin || this.options.templateCompiler.unregisterPlugin
this.unregisterPlugin = this.options.templateCompiler.unregisterPlugin;

this.registerPlugins();
this.initializeFeatures();
Expand Down
8 changes: 4 additions & 4 deletions node-tests/ast_plugins_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { createTempDir, createBuilder } = require('broccoli-test-helper');
const fixturify = require('fixturify');
const addDependencyTracker = require("../addDependencyTracker");
const templateCompiler = require('ember-source/dist/ember-template-compiler.js');
const REQUIRES_LEGACY_AST_PLUGINS = typeof templateCompiler.removePlugin === "function"; // XXX Is there a better way to detect this? I'd rather just skip this test.
const CANNOT_UNREGISTER_PLUGINS = !(templateCompiler.unregisterPlugin);

describe('AST plugins', function(){
const they = it;
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('AST plugins', function(){
const DivRewriter = addDependencyTracker(DivRewriterImpl, true);

they('are accepted and used.', co.wrap(function* () {
if (REQUIRES_LEGACY_AST_PLUGINS) {
if (CANNOT_UNREGISTER_PLUGINS) {
this.skip();
}
htmlbarsOptions.plugins = {
Expand All @@ -107,7 +107,7 @@ describe('AST plugins', function(){
}));

they('will bust the hot cache if the dependency changes.', co.wrap(function* () {
if (REQUIRES_LEGACY_AST_PLUGINS) {
if (CANNOT_UNREGISTER_PLUGINS) {
this.skip();
}
Object.assign(htmlbarsOptions, {
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('AST plugins', function(){
});

they('will bust the persistent cache if the template cache key changes.', co.wrap(function* () {
if (REQUIRES_LEGACY_AST_PLUGINS) {
if (CANNOT_UNREGISTER_PLUGINS) {
this.skip();
}
Object.assign(htmlbarsOptions, {
Expand Down

0 comments on commit bc85143

Please sign in to comment.