File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ module.exports = karmaConfig({
1212 browsers : {
1313 chrome : host . ci ? host . os . linux : true ,
1414 firefox : host . ci ? host . os . linux : true ,
15- safari : host . ci ? host . os . linux : host . os . mac , // SauceLabs in CI
16- edge : host . ci ? host . os . linux : host . os . windows , // SauceLabs in CI
17- ie : host . ci ? host . os . windows : false , // IE needs to run by itself, due to Babel transforms
15+ safari : host . ci ? host . os . linux : host . os . mac ,
16+ edge : host . ci ? host . os . linux : host . os . windows ,
17+ ie : host . os . windows ,
1818 } ,
1919 config : {
2020 // Prevent Karma-Config from using the "karma-host-environment" framework,
Original file line number Diff line number Diff line change @@ -24,6 +24,23 @@ describe("Browser environment", () => {
2424
2525 }
2626 else {
27+ /* eslint-env browser */
28+
29+ it ( "host.path should be the current page" , ( ) => {
30+ expect ( host . path ) . to . equal ( window . location . href ) ;
31+ } ) ;
32+
33+ it ( "host.url should be the current page" , ( ) => {
34+ expect ( host . url . href ) . to . deep . equal ( window . location . href ) ;
35+ } ) ;
36+
37+ it ( "host.cwd should be the parent directory of the current page" , ( ) => {
38+ expect ( window . location . href ) . to . contain ( host . cwd ) ;
39+ } ) ;
40+
41+ it ( "host.cwdURL should be the parent directory of the current page" , ( ) => {
42+ expect ( window . location . href ) . to . contain ( host . cwdURL . href ) ;
43+ } ) ;
2744
2845 it ( "host.browser should be an object" , ( ) => {
2946 expect ( host . browser ) . to . be . an ( "object" ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,24 @@ describe("Node.js environment", () => {
1313
1414 }
1515 else {
16+ /* eslint-env node */
17+
18+ it ( "host.path should be the execPath" , ( ) => {
19+ expect ( host . path ) . to . equal ( process . execPath ) ;
20+ } ) ;
21+
22+ it ( "host.url should be a file:// URL" , ( ) => {
23+ expect ( host . url . href ) . to . match ( / ^ f i l e : \/ \/ / ) ;
24+ } ) ;
25+
26+ it ( "host.cwd should be the current working directory" , ( ) => {
27+ expect ( host . cwd ) . to . equal ( process . cwd ( ) ) ;
28+ } ) ;
29+
30+ it ( "host.cwdURL should be a file:// URL" , ( ) => {
31+ expect ( host . cwdURL . href ) . to . match ( / ^ f i l e : \/ \/ / ) ;
32+ } ) ;
33+
1634
1735 it ( "host.node should be an object" , ( ) => {
1836 expect ( host . node ) . to . be . an ( "object" ) ;
You can’t perform that action at this time.
0 commit comments