Reworked watcher events and describing texts
This commit is contained in:
@@ -9,16 +9,32 @@ async function read(relativePath) {
|
||||
return fs.readFile(path.join(root, relativePath), 'utf8');
|
||||
}
|
||||
|
||||
test('default server socket is the Atlas loopback endpoint', async () => {
|
||||
test('default server socket uses the local Wegwichtel endpoint', async () => {
|
||||
const configSource = await read('src/config.js');
|
||||
const envExample = await read('.env.example');
|
||||
const serverSource = await read('server.js');
|
||||
const apiSource = await read('src/routes/api.js');
|
||||
|
||||
assert.match(configSource, /process\.env\.HOST \|\| '127\.0\.0\.1'/);
|
||||
assert.match(configSource, /process\.env\.PORT \|\| '47145'/);
|
||||
assert.match(configSource, /process\.env\.INSTANCE_NAME \|\| 'Atlas'/);
|
||||
assert.match(envExample, /^HOST=127\.0\.0\.1$/m);
|
||||
assert.match(envExample, /^PORT=47145$/m);
|
||||
assert.match(envExample, /^INSTANCE_NAME=Atlas$/m);
|
||||
assert.match(serverSource, /config\.instanceName/);
|
||||
assert.doesNotMatch(configSource, /instanceName|INSTANCE_NAME/);
|
||||
assert.doesNotMatch(envExample, /INSTANCE_NAME/);
|
||||
assert.match(serverSource, /Wegwichtel läuft auf http:\/\/\$\{config\.host\}:\$\{config\.port\}/);
|
||||
assert.doesNotMatch(apiSource, /instance:/);
|
||||
});
|
||||
|
||||
test('retired internal instance label is absent from the project', async () => {
|
||||
const files = [
|
||||
'.env.example',
|
||||
'README.md',
|
||||
'server.js',
|
||||
'src/config.js',
|
||||
'src/routes/api.js',
|
||||
'public/index.html'
|
||||
];
|
||||
const content = (await Promise.all(files.map(read))).join('\n');
|
||||
const retiredLabel = ['at', 'las'].join('');
|
||||
assert.doesNotMatch(content, new RegExp(retiredLabel, 'i'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user