forked from NichenFly/slimerjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-system.js
36 lines (33 loc) · 1.34 KB
/
test-system.js
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
33
34
35
36
describe("system module", function() {
it("should be in a system object", function(){
expect('system' in slimerEnv).toBeTruthy();
});
it("should have a platform property", function(){
expect('platform' in system).toBeTruthy();
expect(system.platform).toNotEqual('');
});
it("should have a pid property", function(){
expect('pid' in system).toBeTruthy();
expect(system.pid).toEqual(0); // no way in mozilla to retrieve the PID
});
it("should have a os object", function(){
expect('os' in system).toBeTruthy();
expect('architecture' in system.os).toBeTruthy();
expect('name' in system.os).toBeTruthy();
expect('version' in system.os).toBeTruthy();
expect(system.os.architecture).toNotEqual('');
expect(system.os.name).toNotEqual('');
if (system.os.name == 'linux') {
expect(system.os.isWindows()).toEqual(false);
}
else {
expect(system.os.isWindows()).toEqual(true);
}
//expect(system.os.version).toNotEqual(''); // it is '' on some system...
});
it("should handle command line arguments", function(){
expect('args' in system).toBeTruthy();
expect(system.args.length).toEqual(1);
expect(/launch-main-tests\.js$/.test(system.args[0])).toBeTruthy();
});
});