uvu#suite JavaScript Examples
The following examples show how to use
uvu#suite.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.spec.js From alpinejs-devtools with MIT License | 6 votes |
ComponentNameTest = suite('getComponentName')
Example #2
Source File: api.js From klona with MIT License | 6 votes |
export default function (klona) {
const API = suite('exports');
API('should export a function', () => {
assert.type(klona, 'function');
});
API.run();
}
Example #3
Source File: resolve.js From resolve.exports with MIT License | 6 votes |
unsafe = suite('options.unsafe', {
"exports": {
".": {
"production": "$prod",
"development": "$dev",
"default": "$default",
},
"./spec/type": {
"import": "$import",
"require": "$require",
"default": "$default"
},
"./spec/env": {
"worker": {
"default": "$worker"
},
"browser": "$browser",
"node": "$node",
"default": "$default"
}
}
})
Example #4
Source File: $utils.js From tempura with MIT License | 6 votes |
API = suite('API')
Example #5
Source File: utils.js From uvu with MIT License | 6 votes |
capitalize = suite('capitalize')
Example #6
Source File: url.spec.js From kit with MIT License | 6 votes |
/**
*
* @param {string} name
* @param {(suite: import('uvu').Test<import('uvu').Context>) => void} fn
*/
function describe(name, fn) {
const s = suite(name);
fn(s);
s.run();
}
Example #7
Source File: descriptor.js From klona with MIT License | 5 votes |
export default function (klona) {
const Descriptors = suite('Descriptor');
Descriptors('hidden', () => {
const input = { foo: 123 };
Object.defineProperty(input, 'bar', {
enumerable: false,
value: [1, 2, 3]
});
const output = klona(input);
assert.deepEqual(input, output);
assert.deepEqual(
Object.getOwnPropertyDescriptor(output, 'bar'),
{
enumerable: false,
configurable: false,
writable: false,
value: [1, 2, 3]
}
);
output.bar.push('howdy');
assert.deepEqual(input.bar, [1, 2, 3]);
});
Descriptors('hidden writable configurable', () => {
const input = { foo: 123 };
Object.defineProperty(input, 'bar', {
enumerable: false,
configurable: true,
writable: true,
value: [1, 2, 3]
});
const output = klona(input);
assert.deepEqual(input, output);
assert.deepEqual(
Object.getOwnPropertyDescriptor(output, 'bar'),
{
enumerable: false,
configurable: true,
writable: true,
value: [1, 2, 3]
}
);
output.bar.push('howdy');
assert.deepEqual(input.bar, [1, 2, 3]);
});
Descriptors('hidden getter', () => {
const input = { foo: 123 };
Object.defineProperty(input, 'bar', {
enumerable: false,
get() {
return [1, 2, 3]
}
});
const output = klona(input);
assert.deepEqual(input, output);
const xyz = Object.getOwnPropertyDescriptor(output, 'bar');
assert.equal(typeof xyz.get, 'function');
output.bar.push('howdy');
assert.deepEqual(input.bar, [1, 2, 3]);
assert.deepEqual(output.bar, [1, 2, 3]);
});
Descriptors.run();
}
Example #8
Source File: legacy.js From resolve.exports with MIT License | 5 votes |
legacy = suite('$.legacy')
Example #9
Source File: $index.js From tempura with MIT License | 5 votes |
transform = suite('transform')
Example #10
Source File: math.js From uvu with MIT License | 5 votes |
sum = suite('sum')