mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-28 06:55:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
98
webGl/my-threejs-test/node_modules/@parcel/utils/test/config.test.js
generated
vendored
Normal file
98
webGl/my-threejs-test/node_modules/@parcel/utils/test/config.test.js
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
// @flow strict-local
|
||||
|
||||
import assert from 'assert';
|
||||
import {loadConfig} from '../src/config';
|
||||
import {inputFS as fs} from '@parcel/test-utils';
|
||||
import path from 'path';
|
||||
|
||||
describe('loadConfig', () => {
|
||||
it('load config with json', async () => {
|
||||
assert.deepEqual(
|
||||
(
|
||||
await loadConfig(
|
||||
fs,
|
||||
path.join(__dirname, './input/config/config.json'),
|
||||
['config.json'],
|
||||
path.join(__dirname, './input/config/'),
|
||||
)
|
||||
)?.config,
|
||||
{
|
||||
hoge: 'fuga',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw error with empty string json', async () => {
|
||||
// $FlowFixMe[prop-missing]
|
||||
await assert.rejects(async () => {
|
||||
await loadConfig(
|
||||
fs,
|
||||
path.join(__dirname, './input/config/empty.json'),
|
||||
['empty.json'],
|
||||
path.join(__dirname, './input/config/'),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should load with empty string config toml', async () => {
|
||||
assert.deepEqual(
|
||||
(
|
||||
await loadConfig(
|
||||
fs,
|
||||
path.join(__dirname, './input/config/empty.toml'),
|
||||
['empty.toml'],
|
||||
path.join(__dirname, './input/config/'),
|
||||
)
|
||||
)?.config,
|
||||
{},
|
||||
);
|
||||
});
|
||||
|
||||
it('should load with js', async () => {
|
||||
assert.deepEqual(
|
||||
(
|
||||
await loadConfig(
|
||||
fs,
|
||||
path.join(__dirname, './input/config/config.js'),
|
||||
['config.js'],
|
||||
path.join(__dirname, './input/config/'),
|
||||
)
|
||||
)?.config,
|
||||
{
|
||||
hoge: 'fuga',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should load with cjs', async () => {
|
||||
assert.deepEqual(
|
||||
(
|
||||
await loadConfig(
|
||||
fs,
|
||||
path.join(__dirname, './input/config/config.cjs'),
|
||||
['config.cjs'],
|
||||
path.join(__dirname, './input/config/'),
|
||||
)
|
||||
)?.config,
|
||||
{
|
||||
hoge: 'fuga',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should load without an extension as json', async () => {
|
||||
assert.deepEqual(
|
||||
(
|
||||
await loadConfig(
|
||||
fs,
|
||||
path.join(__dirname, './input/config/.testrc'),
|
||||
['.testrc'],
|
||||
path.join(__dirname, './input/config/'),
|
||||
)
|
||||
)?.config,
|
||||
{
|
||||
hoge: 'fuga',
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user