mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-02 06:39:46 +08:00
feat: merge service (#14384)
This commit is contained in:
@@ -68,12 +68,14 @@ test('should read DEPLOYMENT_TYPE', t => {
|
||||
|
||||
test('should read FLAVOR', t => {
|
||||
t.deepEqual(
|
||||
['allinone', 'graphql', 'sync', 'renderer', 'doc', 'script'].map(envVal => {
|
||||
process.env.SERVER_FLAVOR = envVal;
|
||||
const env = new Env();
|
||||
return env.FLAVOR;
|
||||
}),
|
||||
['allinone', 'graphql', 'sync', 'renderer', 'doc', 'script']
|
||||
['allinone', 'graphql', 'sync', 'renderer', 'front', 'doc', 'script'].map(
|
||||
envVal => {
|
||||
process.env.SERVER_FLAVOR = envVal;
|
||||
const env = new Env();
|
||||
return env.FLAVOR;
|
||||
}
|
||||
),
|
||||
['allinone', 'graphql', 'sync', 'renderer', 'front', 'doc', 'script']
|
||||
);
|
||||
|
||||
t.throws(
|
||||
@@ -83,7 +85,7 @@ test('should read FLAVOR', t => {
|
||||
},
|
||||
{
|
||||
message:
|
||||
'Invalid value "unknown" for environment variable SERVER_FLAVOR, expected one of ["allinone","graphql","sync","renderer","doc","script"]',
|
||||
'Invalid value "unknown" for environment variable SERVER_FLAVOR, expected one of ["allinone","graphql","sync","renderer","front","doc","script"]',
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -110,6 +112,7 @@ test('should tell flavors correctly', t => {
|
||||
graphql: true,
|
||||
sync: true,
|
||||
renderer: true,
|
||||
front: false,
|
||||
doc: true,
|
||||
script: false,
|
||||
});
|
||||
@@ -119,6 +122,17 @@ test('should tell flavors correctly', t => {
|
||||
graphql: true,
|
||||
sync: false,
|
||||
renderer: false,
|
||||
front: false,
|
||||
doc: false,
|
||||
script: false,
|
||||
});
|
||||
|
||||
process.env.SERVER_FLAVOR = 'front';
|
||||
t.deepEqual(new Env().flavors, {
|
||||
graphql: false,
|
||||
sync: false,
|
||||
renderer: false,
|
||||
front: true,
|
||||
doc: false,
|
||||
script: false,
|
||||
});
|
||||
@@ -128,6 +142,7 @@ test('should tell flavors correctly', t => {
|
||||
graphql: false,
|
||||
sync: false,
|
||||
renderer: false,
|
||||
front: false,
|
||||
doc: false,
|
||||
script: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user