Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pref: optimize test #341

Merged
merged 20 commits into from
Aug 9, 2024
Prev Previous commit
Next Next commit
chore: update
  • Loading branch information
zyyv committed Aug 1, 2024
commit f6ff9889c24ead6f7a64e617288f7313fcfab0f3
2 changes: 1 addition & 1 deletion test/alpha.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Tests for the alpha channel', () => {
it('setting & getting alpha channel', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/analyze.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const analyze = chroma.analyze;

Expand Down
2 changes: 1 addition & 1 deletion test/autodetect.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('autodetect color', () => {
it('autodetect named color', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/average.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const average = chroma.average;

Expand Down
2 changes: 1 addition & 1 deletion test/bezier.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const bezier = chroma.bezier;

Expand Down
2 changes: 1 addition & 1 deletion test/blend.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const blend = chroma.blend;

Expand Down
2 changes: 1 addition & 1 deletion test/color.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const Color = chroma.Color;

Expand Down
2 changes: 1 addition & 1 deletion test/contrast.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const contrast = chroma.contrast;

Expand Down
2 changes: 1 addition & 1 deletion test/converters.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Testing color conversions', () => {
for (const colorName in chroma.colors) {
Expand Down
2 changes: 1 addition & 1 deletion test/css2rgb.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const css2rgb = chroma.input.format.css;

Expand Down
2 changes: 1 addition & 1 deletion test/cubehelix.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const cubehelix = chroma.cubehelix;

Expand Down
2 changes: 1 addition & 1 deletion test/delta-e.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const deltaE = chroma.deltaE;

Expand Down
2 changes: 1 addition & 1 deletion test/docs.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import fs from 'node:fs';
import chroma_ from '../dist/index.mjs';
import chroma_ from '../dist/index.js';

const DOCS = fs.readFileSync(__dirname + '/../docs/src/index.md', 'utf-8');

Expand Down
2 changes: 1 addition & 1 deletion test/lch.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Some tests for chroma.lch()', () => {
describe('lch grayscale', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/luminance.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const rnd = function (f, d) {
d = Math.pow(10, d);
Expand Down
2 changes: 1 addition & 1 deletion test/manipulate.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Manipulating colors', () => {
it('darken', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/misc.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const round = function (digits) {
var d;
Expand Down
2 changes: 1 addition & 1 deletion test/mix.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Some tests for chroma.color()', () => {
it('hsv interpolation white <-> red', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/num.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Some tests for chroma.num()', () => {
it('number output', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/premultiply.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Premultiply colors', () => {
it('premultiply rgba', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/random.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

describe('Some tests for random colors', () => {
it('should generate valid hex codes for random colors', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/scale.lcorrection.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const scale = chroma.scale;

Expand Down
2 changes: 1 addition & 1 deletion test/scales.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const scale = chroma.scale;

Expand Down
2 changes: 1 addition & 1 deletion test/valid.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import chroma from '../dist/index.mjs';
import chroma from '../dist/index.js';

const valid = chroma.valid;

Expand Down