mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-22 18:29:26 +00:00
40 lines
982 B
JavaScript
40 lines
982 B
JavaScript
import {dirname} from 'node:path';
|
|
import {fileURLToPath} from 'node:url';
|
|
import fs from 'node:fs';
|
|
import test from 'supertape';
|
|
import {getColumns, isDev} from './columns.mjs';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
test('columns: prod', (t) => {
|
|
const columns = getColumns({
|
|
isDev: false,
|
|
});
|
|
|
|
t.equal(columns[''], '');
|
|
t.end();
|
|
});
|
|
|
|
test('columns: dev', (t) => {
|
|
const columns = getColumns({
|
|
isDev: true,
|
|
});
|
|
|
|
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
|
|
|
|
t.match(columns['name-size-date'], css);
|
|
t.end();
|
|
});
|
|
|
|
test('columns: no args', (t) => {
|
|
const currentIsDev = isDev();
|
|
isDev(true);
|
|
const columns = getColumns();
|
|
|
|
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
|
|
isDev(currentIsDev);
|
|
|
|
t.match(columns['name-size-date'], css);
|
|
t.end();
|
|
});
|