mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
31 lines
790 B
JavaScript
31 lines
790 B
JavaScript
import {dirname} from 'node:path';
|
|
import {fileURLToPath} from 'node:url';
|
|
import fs from 'node:fs';
|
|
import test from 'supertape';
|
|
import {getThemes, isDev} from './theme.mjs';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
test('themes: dev', (t) => {
|
|
const themes = getThemes({
|
|
isDev: true,
|
|
});
|
|
|
|
const css = fs.readFileSync(`${__dirname}/../css/themes/dark.css`, 'utf8');
|
|
|
|
t.ok(themes.dark.includes(css));
|
|
t.end();
|
|
});
|
|
|
|
test('themes: no args', (t) => {
|
|
const currentIsDev = isDev();
|
|
isDev(true);
|
|
const themes = getThemes();
|
|
|
|
const css = fs.readFileSync(`${__dirname}/../css/themes/light.css`, 'utf8');
|
|
isDev(currentIsDev);
|
|
|
|
t.ok(themes.light.includes(css));
|
|
t.end();
|
|
});
|