summary refs log tree commit diff stats
path: root/javascript/resistor-color/resistor-color.spec.js
blob: e4031296ab58abf9db3c73858123a63aacd72dc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { colorCode, COLORS } from './resistor-color';

describe('ResistorColor', () => {
  describe('Color codes', () => {
    test('Black', () => {
      expect(colorCode('black')).toEqual(0);
    });

    test('White', () => {
      expect(colorCode('white')).toEqual(9);
    });

    test('Orange', () => {
      expect(colorCode('orange')).toEqual(3);
    });
  });

  test('Colors', () => {
    expect(COLORS).toEqual([
      'black',
      'brown',
      'red',
      'orange',
      'yellow',
      'green',
      'blue',
      'violet',
      'grey',
      'white',
    ]);
  });
});