2022-05-17 12:18:06 +00:00
|
|
|
import { describe, expect, it } from '@jest/globals';
|
2020-12-08 00:03:06 +00:00
|
|
|
import execa from 'execa';
|
2021-10-06 22:01:43 +00:00
|
|
|
import path from 'path';
|
2020-12-08 00:03:06 +00:00
|
|
|
|
2023-05-30 09:56:51 +00:00
|
|
|
const binPath = path.resolve('../insomnia-inso/binaries/inso');
|
2021-10-06 22:01:43 +00:00
|
|
|
|
2023-05-30 09:56:51 +00:00
|
|
|
describe('inso basic features', () => {
|
2021-10-06 22:01:43 +00:00
|
|
|
describe('run test', () => {
|
2023-05-30 09:56:51 +00:00
|
|
|
it('should not fail running tests', async () => {
|
|
|
|
const { failed } = await execa(binPath, [
|
2021-10-06 22:01:43 +00:00
|
|
|
'run',
|
|
|
|
'test',
|
2023-05-30 09:56:51 +00:00
|
|
|
'--src',
|
|
|
|
'fixtures/inso-nedb',
|
|
|
|
'--env',
|
|
|
|
'Dev',
|
2021-10-06 22:01:43 +00:00
|
|
|
'Echo Test Suite',
|
2022-03-03 13:42:04 +00:00
|
|
|
'--verbose',
|
2023-05-30 09:56:51 +00:00
|
|
|
]);
|
2021-10-06 22:01:43 +00:00
|
|
|
|
|
|
|
expect(failed).toBe(false);
|
2023-06-14 14:42:01 +00:00
|
|
|
}, 20 * 1000);
|
2021-10-06 22:01:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('generate config', () => {
|
2023-05-30 09:56:51 +00:00
|
|
|
it('should not fail generating config', async () => {
|
|
|
|
const { failed } = await execa(binPath, [
|
2021-10-06 22:01:43 +00:00
|
|
|
'generate',
|
|
|
|
'config',
|
2023-05-30 09:56:51 +00:00
|
|
|
'--src',
|
|
|
|
'fixtures/inso-nedb',
|
2021-10-06 22:01:43 +00:00
|
|
|
'Smoke Test API server 1.0.0',
|
2023-05-30 09:56:51 +00:00
|
|
|
]);
|
2021-10-06 22:01:43 +00:00
|
|
|
|
|
|
|
expect(failed).toBe(false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('lint spec', () => {
|
2023-05-30 09:56:51 +00:00
|
|
|
it('should not fail linting spec', async () => {
|
|
|
|
const { failed } = await execa(binPath, [
|
2021-10-06 22:01:43 +00:00
|
|
|
'lint',
|
|
|
|
'spec',
|
2023-05-30 09:56:51 +00:00
|
|
|
'--src',
|
|
|
|
'fixtures/inso-nedb',
|
2021-10-06 22:01:43 +00:00
|
|
|
'Smoke Test API server 1.0.0',
|
2023-05-30 09:56:51 +00:00
|
|
|
]);
|
2021-10-06 22:01:43 +00:00
|
|
|
|
|
|
|
expect(failed).toBe(false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('export spec', () => {
|
2023-05-30 09:56:51 +00:00
|
|
|
it('should not fail linting spec', async () => {
|
|
|
|
const { failed } = await execa(binPath, [
|
2021-10-06 22:01:43 +00:00
|
|
|
'export',
|
|
|
|
'spec',
|
2023-05-30 09:56:51 +00:00
|
|
|
'--src',
|
|
|
|
'fixtures/inso-nedb',
|
2021-10-06 22:01:43 +00:00
|
|
|
'Smoke Test API server 1.0.0',
|
2023-05-30 09:56:51 +00:00
|
|
|
]);
|
2021-10-06 22:01:43 +00:00
|
|
|
|
|
|
|
expect(failed).toBe(false);
|
|
|
|
});
|
2020-12-08 00:03:06 +00:00
|
|
|
});
|
|
|
|
});
|