@@ -3,8 +3,8 @@ import { expect, describe, test } from 'vitest';
33// import env variables to simulate 256 colors (auto detecting)
44import './env/ansi256-colors.js' ;
55
6- //import { Ansis, hex } from '../src/index.mjs'; // for debugging only
7- import ansis , { Ansis , hex } from 'ansis' ;
6+ //import ansis, { Ansis } from '../src/index.mjs'; // for debugging only
7+ import ansis , { Ansis } from 'ansis' ;
88
99describe ( 'color level' , ( ) => {
1010 test ( `ansis.level` , ( ) => {
@@ -14,39 +14,39 @@ describe('color level', () => {
1414 } ) ;
1515
1616 test ( `fallback to 256 colors` , ( ) => {
17- const received = hex ( '#00c200' ) `foo` ;
17+ const received = ansis . hex ( '#00c200' ) `foo` ;
1818 const expected = '[38;5;40mfoo[39m' ;
1919 expect ( received ) . toEqual ( expected ) ;
2020 } ) ;
2121
2222 test ( `force use truecolor` , ( ) => {
23- const { hex } = new Ansis ( 3 ) ;
23+ const ansis = new Ansis ( 3 ) ;
2424
25- const received = hex ( '#00c200' ) `foo` ;
25+ const received = ansis . hex ( '#00c200' ) `foo` ;
2626 const expected = '[38;2;0;194;0mfoo[39m' ;
2727 expect ( received ) . toEqual ( expected ) ;
2828 } ) ;
2929
3030 test ( `force use 256 colors` , ( ) => {
31- const { hex } = new Ansis ( 2 ) ;
31+ const ansis = new Ansis ( 2 ) ;
3232
33- const received = hex ( '#00c200' ) `foo` ;
33+ const received = ansis . hex ( '#00c200' ) `foo` ;
3434 const expected = '[38;5;40mfoo[39m' ;
3535 expect ( received ) . toEqual ( expected ) ;
3636 } ) ;
3737
3838 test ( `force use 16 colors` , ( ) => {
39- const { hex } = new Ansis ( 1 ) ;
39+ const ansis = new Ansis ( 1 ) ;
4040
41- const received = hex ( '#00c200' ) `foo` ;
41+ const received = ansis . hex ( '#00c200' ) `foo` ;
4242 const expected = '[32mfoo[39m' ;
4343 expect ( received ) . toEqual ( expected ) ;
4444 } ) ;
4545
4646 test ( `force disable colors` , ( ) => {
47- const { hex } = new Ansis ( 0 ) ;
47+ const ansis = new Ansis ( 0 ) ;
4848
49- const received = hex ( '#00c200' ) `foo` ;
49+ const received = ansis . hex ( '#00c200' ) `foo` ;
5050 const expected = 'foo' ;
5151 expect ( received ) . toEqual ( expected ) ;
5252 } ) ;
0 commit comments