@@ -28,6 +28,30 @@ const testResourcePath = 'system-test/resources';
2828
2929test . before ( tools . checkCredentials ) ;
3030
31+ test ( `should redact a single sensitive data type from a string` , async t => {
32+ const output = await tools . runAsync (
33+ `${ cmd } string "My email is jenny@example.com" -t EMAIL_ADDRESS` ,
34+ cwd
35+ ) ;
36+ t . regex ( output , / M y e m a i l i s \[ E M A I L _ A D D R E S S \] / ) ;
37+ } ) ;
38+
39+ test ( `should redact multiple sensitive data types from a string` , async t => {
40+ const output = await tools . runAsync (
41+ `${ cmd } string "I am 29 years old and my email is jenny@example.com" -t EMAIL_ADDRESS AGE` ,
42+ cwd
43+ ) ;
44+ t . regex ( output , / I a m \[ A G E \] a n d m y e m a i l i s \[ E M A I L _ A D D R E S S \] / ) ;
45+ } ) ;
46+
47+ test ( `should handle string with no sensitive data` , async t => {
48+ const output = await tools . runAsync (
49+ `${ cmd } string "No sensitive data to redact here" -t EMAIL_ADDRESS AGE` ,
50+ cwd
51+ ) ;
52+ t . regex ( output , / N o s e n s i t i v e d a t a t o r e d a c t h e r e / ) ;
53+ } ) ;
54+
3155// redact_image
3256test ( `should redact a single sensitive data type from an image` , async t => {
3357 const testName = `redact-single-type` ;
@@ -61,6 +85,14 @@ test(`should redact multiple sensitive data types from an image`, async t => {
6185 t . deepEqual ( correct , result ) ;
6286} ) ;
6387
88+ test ( `should report info type errors` , async t => {
89+ const output = await tools . runAsync (
90+ `${ cmd } string "My email is jenny@example.com" -t NONEXISTENT` ,
91+ cwd
92+ ) ;
93+ t . regex ( output , / E r r o r i n d e i d e n t i f y C o n t e n t / ) ;
94+ } ) ;
95+
6496test ( `should report image redaction handling errors` , async t => {
6597 const output = await tools . runAsync (
6698 `${ cmd } image ${ testImage } nonexistent.result.png -t BAD_TYPE` ,
0 commit comments