@@ -3,7 +3,7 @@ const config = require('config');
3
3
const altConfig = require ( '@alt-javascript/config' ) . config ;
4
4
const { EphemeralConfig, ConfigFactory, ValueResolvingConfig} = require ( '@alt-javascript/config' ) ;
5
5
const { boot} = require ( '..' ) ;
6
- const { CachingLoggerFactory, LoggerFactory, LoggerRegistry } = require ( '@alt-javascript/logger' ) ;
6
+ const { CachingLoggerFactory, LoggerFactory, LoggerCategoryCache } = require ( '@alt-javascript/logger' ) ;
7
7
const logger = LoggerFactory . getLogger ( '@alt-javascript/boot/test/boot_spec' , config ) ;
8
8
9
9
before ( async ( ) => {
@@ -36,18 +36,18 @@ describe('boot function', () => {
36
36
} ) ;
37
37
it ( 'boot - config ' , ( ) => {
38
38
const config = new EphemeralConfig ( { } ) ;
39
- boot ( config ) ;
39
+ boot ( { config : config } ) ;
40
40
assert . instanceOf ( global . boot . contexts . root . config , ValueResolvingConfig , 'global.boot.contexts.root.config instanceof ValueResolvingConfig' ) ;
41
41
assert . instanceOf ( global . boot . contexts . root . loggerFactory , LoggerFactory , 'global.boot.contexts.root.loggerFactory instanceof LoggerFactory' ) ;
42
- assert . instanceOf ( global . boot . contexts . root . loggerRegistry , LoggerRegistry , 'global.boot.contexts.root.loggerRegistry instanceof loggerRegistry ' ) ;
42
+ assert . instanceOf ( global . boot . contexts . root . loggerCategoryCache , LoggerCategoryCache , 'global.boot.contexts.root.loggerCategoryCache instanceof loggerCategoryCache ' ) ;
43
43
global . boot = undefined ;
44
44
} ) ;
45
45
it ( 'boot - config with ValueResolvingConfig ' , ( ) => {
46
46
const config = ConfigFactory . getConfig ( new EphemeralConfig ( { } ) ) ;
47
- boot ( config ) ;
47
+ boot ( { config : config } ) ;
48
48
assert . instanceOf ( global . boot . contexts . root . config , ValueResolvingConfig , 'global.boot.contexts.root.config instanceof ValueResolvingConfig' ) ;
49
49
assert . instanceOf ( global . boot . contexts . root . loggerFactory , LoggerFactory , 'global.boot.contexts.root.loggerFactory instanceof LoggerFactory' ) ;
50
- assert . instanceOf ( global . boot . contexts . root . loggerRegistry , LoggerRegistry , 'global.boot.contexts.root.loggerRegistry instanceof loggerRegistry ' ) ;
50
+ assert . instanceOf ( global . boot . contexts . root . loggerCategoryCache , LoggerCategoryCache , 'global.boot.contexts.root.loggerCategoryCache instanceof loggerCategoryCache ' ) ;
51
51
global . boot = undefined ;
52
52
} ) ;
53
53
@@ -57,7 +57,7 @@ describe('boot function', () => {
57
57
boot ( ) ;
58
58
assert . instanceOf ( global . boot . contexts . root . config , ValueResolvingConfig , 'global.boot.contexts.root.config instanceof ValueResolvingConfig' ) ;
59
59
assert . instanceOf ( global . boot . contexts . root . loggerFactory , LoggerFactory , 'global.boot.contexts.root.loggerFactory instanceof LoggerFactory' ) ;
60
- assert . instanceOf ( global . boot . contexts . root . loggerRegistry , LoggerRegistry , 'global.boot.contexts.root.loggerRegistry instanceof loggerRegistry ' ) ;
60
+ assert . instanceOf ( global . boot . contexts . root . loggerCategoryCache , LoggerCategoryCache , 'global.boot.contexts.root.loggerCategoryCache instanceof loggerCategoryCache ' ) ;
61
61
global . boot = undefined ;
62
62
global . config = undefined ;
63
63
} ) ;
@@ -68,16 +68,16 @@ describe('boot function', () => {
68
68
boot ( ) ;
69
69
assert . instanceOf ( global . window . boot . contexts . root . config , ValueResolvingConfig , 'global.boot.contexts.root.config instanceof ValueResolvingConfig' ) ;
70
70
assert . instanceOf ( global . window . boot . contexts . root . loggerFactory , LoggerFactory , 'global.boot.contexts.root.loggerFactory instanceof LoggerFactory' ) ;
71
- assert . instanceOf ( global . window . boot . contexts . root . loggerRegistry , LoggerRegistry , 'global.boot.contexts.root.loggerRegistry instanceof loggerRegistry ' ) ;
71
+ assert . instanceOf ( global . window . boot . contexts . root . loggerCategoryCache , LoggerCategoryCache , 'global.boot.contexts.root.loggerCategoryCache instanceof loggerCategoryCache ' ) ;
72
72
global . boot = undefined ;
73
73
global . window = undefined ;
74
74
} ) ;
75
75
76
76
it ( 'boot - LoggerFactory detects boot root context' , ( ) => {
77
77
const config = new EphemeralConfig ( { logging :{ level :{ '/' : 'info' } } } ) ;
78
- const cachingLoggerFactory = new CachingLoggerFactory ( config , new LoggerRegistry ( ) ) ;
78
+ const cachingLoggerFactory = new CachingLoggerFactory ( config , new LoggerCategoryCache ( ) ) ;
79
79
80
- boot ( config , cachingLoggerFactory ) ;
80
+ boot ( { config : config , loggerFactory : cachingLoggerFactory } ) ;
81
81
const logger = LoggerFactory . getLogger ( '@alt-javascript/boot/test/boot_spec' )
82
82
83
83
logger . info ( 'message' ) ;
@@ -87,8 +87,8 @@ describe('boot function', () => {
87
87
} ) ;
88
88
89
89
it ( 'boot - uses config local-development' , ( ) => {
90
- const cachingLoggerFactory = new CachingLoggerFactory ( config , new LoggerRegistry ( ) ) ;
91
- boot ( config , cachingLoggerFactory ) ;
90
+ const cachingLoggerFactory = new CachingLoggerFactory ( config , new LoggerCategoryCache ( ) ) ;
91
+ boot ( { config : config , loggerFactory : cachingLoggerFactory } ) ;
92
92
const logger = LoggerFactory . getLogger ( '@alt-javascript/boot/test/boot_spec/local-development' )
93
93
94
94
logger . debug ( 'message' ) ;
0 commit comments