Skip to content

Commit

Permalink
feat: add theme config option
Browse files Browse the repository at this point in the history
  • Loading branch information
ignace committed Dec 10, 2023
1 parent c193c1e commit de970cf
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions addon/src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
/* globals Testem */
import 'qunit/qunit/qunit.css';

import { macroCondition, getOwnConfig, importSync } from '@embroider/macros';

/**
* Load qunit-theme-ember by default, if no custom theme is specified.
*/
if (
macroCondition(
getOwnConfig()?.theme === undefined ||
getOwnConfig()?.theme === 'qunit-default' ||
getOwnConfig()?.theme === 'ember'
)
) {
importSync('qunit/qunit/qunit.css');
}

if (macroCondition(!getOwnConfig()?.disableContainerStyles)) {
importSync('./test-container-styles.css');
}

importSync('qunit-theme-ember/qunit.css');
if (
macroCondition(
getOwnConfig()?.theme === undefined || getOwnConfig()?.theme === 'ember'
)
) {
importSync('qunit-theme-ember/qunit.css');
}

export { default as QUnitAdapter, nonTestDoneCallback } from './adapter';
export { loadTests } from './test-loader';
Expand Down

0 comments on commit de970cf

Please sign in to comment.