{"size": 1692, "ext": "js", "max_stars_repo_path": "test/redcactus.spec.js", "max_stars_repo_name": "percenuage/redcactus", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/redcactus.spec.js", "max_issues_repo_name": "percenuage/redcactus", "max_issues_repo_issues_event_min_datetime": "2020-09-16T21:12:17.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-16T21:12:17.000Z", "max_forks_repo_path": "test/redcactus.spec.js", "max_forks_repo_name": "percenuage/redcactus", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 33.1764705882, "max_line_length": 85, "alphanum_fraction": 0.6093380615}
const redcactus = require('../src/redcactus');

describe('Status Suite', () => {
    let status;
    beforeAll(async () => {
        status = await redcactus.status();
    });

    it('Status should be an object', () => {
        console.log(status);
        expect(typeof status).toBe('object');
    });

    it('Status should has properties', () => {
        expect(status).toHaveProperty('server');
        expect(status).toHaveProperty('git');
    });

    it('Server should be an object', () => {
        expect(typeof status.server).toBe('object');
    });

    it('Should be an object', () => {
        expect(typeof status.git).toBe('object');
    });

    it('Server should has properties', () => {
        const packageJson = require('../package');
        expect(status.server).toHaveProperty('status', 'up');
        expect(status.server).toHaveProperty('name', packageJson.name);
        expect(status.server).toHaveProperty('description', packageJson.description);
        expect(status.server).toHaveProperty('version', packageJson.version);
        expect(status.server).toHaveProperty('uptime');
        expect(status.server).toHaveProperty('uptime_human');
        expect(status.server).toHaveProperty('started_at');
    });

    it('Should has properties', () => {
        expect(status.git).toHaveProperty('branch');
        expect(status.git).toHaveProperty('sha');
        expect(status.git).toHaveProperty('subject');
        expect(status.git).toHaveProperty('author');
    });

    it('Should disable git status with options', async () => {
        status = await redcactus.status({ disableGitStatus: true });
        expect(status.git).toBeUndefined();
    });

});
