flecks/packages/server/test/runtime-config-override.js

34 lines
830 B
JavaScript
Raw Normal View History

2024-02-05 17:08:26 -06:00
import {join} from 'path';
import {writeFile} from '@flecks/core/server';
2024-02-05 17:08:26 -06:00
import {expect} from 'chai';
2024-02-14 20:16:31 -06:00
import {withServer} from './helpers/with-server';
2024-02-05 17:08:26 -06:00
2024-02-13 06:02:56 -06:00
it('propagates override config', withServer(
2024-02-11 21:03:06 -06:00
async ({server}) => {
const [{payload: id}, {payload: foo}] = await server.actions([
{type: 'config.get', payload: '@flecks/core.id'},
2024-02-18 10:32:18 -06:00
{type: 'config.get', payload: 'server-test.foo'},
2024-02-11 21:03:06 -06:00
{type: 'exit'},
]);
expect(id)
.to.equal('testing');
expect(foo)
.to.equal('baz');
},
{
beforeBuild: async ({path}) => {
await writeFile(
join(path, 'build', 'flecks.yml'),
`
'@flecks/build': {}
'@flecks/core': {id: 'testing'}
'@flecks/server': {}
2024-02-18 10:32:18 -06:00
'server-test:./server-test': {foo: 'baz'}
2024-02-11 21:03:06 -06:00
`,
);
},
},
));