@@ -85,44 +85,43 @@ describe('mongodb-redact', function () {
85
85
expect ( redact ( PRIVATE_KEY ) ) . to . equal ( '<private key>' ) ;
86
86
} ) ;
87
87
88
- it ( 'should redact OS X resource paths' , function ( ) {
89
- const res = redact (
90
- '/Applications/MongoDB%20Compass.app/Contents/Resources/app/index.html'
88
+ it ( 'should redact OS X user paths' , function ( ) {
89
+ let res = redact (
90
+ '/Users/foo/Applications/MongoDB%20Compass.app/Contents/Resources/app/index.html'
91
+ ) ;
92
+ expect ( res ) . to . equal (
93
+ '/Users/<user>/Applications/MongoDB%20Compass.app/Contents/Resources/app/index.html'
91
94
) ;
92
- expect ( res ) . to . equal ( '/<path>/index.html' ) ;
95
+ res = redact ( '/Users/JohnDoe/Documents/letter.pages' ) ;
96
+ expect ( res ) . to . equal ( res , '/Users/<user>/Documents/letter.pages' ) ;
97
+ res = redact ( 'file:///Users/JohnDoe/Documents/letter.pages' ) ;
98
+ expect ( res ) . to . equal ( res , 'file:///Users/<user>/Documents/letter.pages' ) ;
93
99
} ) ;
94
100
95
- it ( 'should redact Windows resource paths using forward slash' , function ( ) {
96
- const res = redact (
101
+ it ( 'should redact Windows user paths using backward slash' , function ( ) {
102
+ let res = redact (
97
103
'C:\\Users\\foo\\AppData\\Local\\MongoDBCompass\\app-1.0.1\\resources\\app\\index.js'
98
104
) ;
99
- expect ( res ) . to . equal ( '\\<path>\\index.js' ) ;
105
+ expect ( res ) . to . equal ( res , 'C:\\Users\\<user>\\index.js' ) ;
106
+ res = redact ( 'c:\\Users\\JohnDoe\\test' ) ;
107
+ expect ( res ) . to . equal ( res , 'c:\\Users\\<user>\\test' ) ;
108
+ res = redact ( 'C:\\Documents and Settings\\JohnDoe\\test' ) ;
109
+ expect ( res ) . to . equal ( res , 'C:\\Documents and Settings\\<user>\\test' ) ;
100
110
} ) ;
101
111
102
- it ( 'should redact Windows resource paths using backward slash' , function ( ) {
112
+ it ( 'should redact Windows user paths using forward slash' , function ( ) {
103
113
const res = redact (
104
114
'C:/Users/foo/AppData/Local/MongoDBCompass/app-1.0.1/resources/app/index.js'
105
115
) ;
106
- expect ( res ) . to . equal ( '/<path>/index.js' ) ;
116
+ expect ( res ) . to . equal (
117
+ res ,
118
+ 'C:/Users/<user>/AppData/Local/MongoDBCompass/app-1.0.1/resources/app/index.js'
119
+ ) ;
107
120
} ) ;
108
121
109
- it ( 'should redact Linux resource paths' , function ( ) {
122
+ it ( 'should redact Linux user paths' , function ( ) {
110
123
const res = redact ( '/usr/foo/myapps/resources/app/index.html' ) ;
111
- expect ( res ) . to . equal ( '/<path>/index.html' ) ;
112
- } ) ;
113
-
114
- it ( 'should redact general Windows user paths' , function ( ) {
115
- let res = redact ( 'c:\\Users\\JohnDoe\\test' ) ;
116
- expect ( res ) . to . equal ( 'c:\\Users\\<user>\\test' ) ;
117
- res = redact ( 'C:\\Documents and Settings\\JohnDoe\\test' ) ;
118
- expect ( res ) . to . equal ( 'C:\\Documents and Settings\\<user>\\test' ) ;
119
- } ) ;
120
-
121
- it ( 'should redact general OS X user paths' , function ( ) {
122
- let res = redact ( '/Users/JohnDoe/Documents/letter.pages' ) ;
123
- expect ( res ) . to . equal ( '/Users/<user>/Documents/letter.pages' ) ;
124
- res = redact ( 'file:///Users/JohnDoe/Documents/letter.pages' ) ;
125
- expect ( res ) . to . equal ( 'file:///Users/<user>/Documents/letter.pages' ) ;
124
+ expect ( res ) . to . equal ( res , '/usr/<user>/myapps/resources/app/index.html' ) ;
126
125
} ) ;
127
126
128
127
it ( 'should redact URLs' , function ( ) {
0 commit comments