How to use the fail function from should

Find comprehensive JavaScript should.fail code examples handpicked from public code repositorys.

75
76
77
78
79
80
81
82
83
84

await cardAssets.clearFiles();

try {
    await fs.readFile(path.join(destDir, 'cards.min.css'), 'utf-8');
    should.fail(cardAssets, 'CSS file should not exist');
} catch (error) {
    if (error instanceof should.AssertionError) {
        throw error;
    }
fork icon0
star icon0
watch icon0