Files
less.js/packages/test-data/plugin/plugin-set-options-v3.js
Matthew Dean 0925cf1957 Test-data module (#3525)
* Move test data to separate module - @todo--fix some browser tests
* Fix all browser tests
2020-06-25 15:54:59 -07:00

32 lines
644 B
JavaScript

var optionsStack = [
'option1',
undefined,
'option2',
undefined,
'option3'
];
var options, error;
registerPlugin({
install: function(less, pluginManager, functions) {
if (options) {
error = 'setOptions() called before install';
}
},
use: function() {
var pos = optionsStack.indexOf(options);
if (pos === -1) {
error = 'setOptions() not setting option "' + opt + '" correctly';
}
if (error) {
throw new Error(error);
}
},
setOptions: function(opts) {
options = opts;
},
minVersion: [3,0,0]
});