Skip to content

Commit d2dd2c2

Browse files
committed
(#8) Removed no longer required tests
1 parent d8b66ce commit d2dd2c2

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

test/bitmap.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,4 @@ describe("Bitmap", () => {
2828
expect(img.height).toEqual(size);
2929
expect(img.width).toEqual(size);
3030
});
31-
32-
it("Get a bitmap and make sure the colorAt works as expected.", function() {
33-
const img = libnut.screen.capture();
34-
const hex = img.colorAt(0, 0);
35-
36-
// t.ok(.it(hex), "colorAt returned valid hex.");
37-
expect(hex).toMatch(/^[0-9A-F]{6}$/i);
38-
39-
const screenSize = libnut.getScreenSize();
40-
let width = screenSize.width;
41-
let height = screenSize.height;
42-
43-
// Support for higher density screens.
44-
const multi = img.width / width;
45-
width = width * multi;
46-
height = height * multi;
47-
expect(() => img.colorAt(0, height)).toThrowError(/are outside the bitmap/);
48-
expect(() => img.colorAt(0, height - 1)).not.toThrow();
49-
expect(() => img.colorAt(width, 0)).toThrowError(/are outside the bitmap/);
50-
expect(() => img.colorAt(9999999999999, 0)).toThrowError(
51-
/are outside the bitmap/
52-
);
53-
expect(() => img.colorAt(0, 9999999999999)).toThrowError(
54-
/are outside the bitmap/
55-
);
56-
});
5731
});

test/screen.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
11
const libnut = require("..");
2-
let pixelColor, screenSize;
32

43
describe("Screen", () => {
5-
it("Get pixel color.", function() {
6-
expect((pixelColor = libnut.getPixelColor(5, 5))).toBeTruthy();
7-
expect(pixelColor !== undefined).toBeTruthy();
8-
expect(pixelColor.length === 6).toBeTruthy();
9-
expect(/^[0-9A-F]{6}$/i.test(pixelColor)).toBeTruthy();
10-
11-
expect(function() {
12-
libnut.getPixelColor(9999999999999, 9999999999999);
13-
}).toThrowError(/outside the main screen/);
14-
15-
expect(function() {
16-
libnut.getPixelColor(-1, -1);
17-
}).toThrowError(/outside the main screen/);
18-
19-
expect(function() {
20-
libnut.getPixelColor(0);
21-
}).toThrowError(/Invalid number/);
22-
23-
expect(function() {
24-
libnut.getPixelColor(1, 2, 3);
25-
}).toThrowError(/Invalid number/);
26-
});
27-
284
it("Get screen size.", function() {
5+
let screenSize;
296
expect((screenSize = libnut.getScreenSize())).toBeTruthy();
307
expect(screenSize.width !== undefined).toBeTruthy();
318
expect(screenSize.height !== undefined).toBeTruthy();

0 commit comments

Comments
 (0)