basicrum / dashboard

0 stars 0 forks source link

Improve testing #13

Open ceckoslab opened 10 months ago

ceckoslab commented 10 months ago

Today our testing is basically comparing 2 JSON files.

Example:

    const expected = JSON.parse(fs.readFileSync(`./testdata/dashboards/${dashboard}.json`, { encoding: 'utf8', flag: 'r' }));
    const actual = JSON.parse(fs.readFileSync(`./build/dashboards/${dashboard}.json`, { encoding: 'utf8', flag: 'r' }));
    expect(actual).toMatchObject(expected);

Where this is convenient for an MVP it will be great if we actually start testing with code if a given panel has the expected configuration.

Let's write some testing code only for the General dashboard in this ticket.

ivan-stankov-golang commented 10 months ago

I am not sure what you want to test here.