Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7860109
config-manager-test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
config-manager-test.js
View Options
var
Sealious
=
require
(
"sealious"
);
module
.
exports
=
{
test_init
:
function
()
{
},
test_start
:
function
()
{
describe
(
"ConfigManager"
,
function
()
{
it
(
"sets config with arguments.length === 1"
,
function
(
done
)
{
try
{
Sealious
.
ConfigManager
.
set_config
(
"some_key"
);
done
();
}
catch
(
e
)
{
done
(
new
Error
(
e
));
}
})
it
(
"sets config with arguments.length === 2 and uses modify_config private function"
,
function
(
done
)
{
try
{
Sealious
.
ConfigManager
.
set_config
(
"this.key"
,
"config"
);
done
();
}
catch
(
e
)
{
done
(
new
Error
(
e
));
}
})
it
(
"sets default config with arguments.length === 1"
,
function
(
done
)
{
try
{
Sealious
.
ConfigManager
.
set_default_config
(
"some_key"
);
done
();
}
catch
(
e
)
{
done
(
new
Error
(
e
));
}
})
it
(
"gets configuration"
,
function
(
done
)
{
var
config
=
Sealious
.
ConfigManager
.
get_configuration
(
"this.key"
);
if
(
config
instanceof
Object
)
done
();
else
done
(
new
Error
(
"It didn't return an object"
))
})
it
(
"gets dispatcher config"
,
function
(
done
)
{
var
dispatcher_config
=
Sealious
.
ConfigManager
.
get_dispatcher_config
();
if
(
dispatcher_config
instanceof
Object
)
if
(
Object
.
getOwnPropertyNames
(
dispatcher_config
).
length
===
0
)
done
();
else
done
(
new
Error
(
"It didn't return an empty object"
))
else
done
(
new
Error
(
"It didn't return an object"
))
})
it
(
"gets non existent chip config and returns undefined"
,
function
(
done
)
{
var
dispatcher_config
=
Sealious
.
ConfigManager
.
get_chip_config
(
"some_non_existent_longid"
);
if
(
dispatcher_config
===
undefined
)
done
();
else
done
(
new
Error
(
"It didn't return undefined"
))
})
})
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 13, 17:15 (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
870988
Default Alt Text
config-manager-test.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment