Skip to content

Commit

Permalink
Merge pull request #78 from abraham/dependabot/npm_and_yarn/prettier-…
Browse files Browse the repository at this point in the history
…3.0.3

Bump prettier from 2.8.8 to 3.0.3
  • Loading branch information
abraham authored Oct 30, 2023
2 parents 03e6464 + 377d0e8 commit 83662ba
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"husky": "^8.0.1",
"jest": "^29.1.2",
"mock-fs": "^5.0.0",
"prettier": "2.8.8",
"prettier": "3.0.3",
"type-fest": "^4.3.3",
"typescript": "^5.0.4"
},
Expand Down
32 changes: 16 additions & 16 deletions src/bin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('pkg-ok', () => {
es2015: 'unknown.js',
browser: 'unknown.js',
exports: 'unknown.js',
})
}),
);
fs.mkdirSync(path.join(directory, 'B'));
fs.writeFileSync(
Expand All @@ -31,14 +31,14 @@ describe('pkg-ok', () => {
X: 'unknown.js',
Y: 'unknown.js',
},
})
}),
);
fs.mkdirSync(path.join(directory, 'C'));
fs.writeFileSync(
path.join(directory, 'C/package.json'),
JSON.stringify({
foo: 'unknown.js',
})
}),
);
fs.mkdirSync(path.join(directory, 'D'));
fs.writeFileSync(
Expand All @@ -48,14 +48,14 @@ describe('pkg-ok', () => {
bar: 'bar',
baz: 'baz',
},
})
}),
);
fs.mkdirSync(path.join(directory, 'E'));
fs.writeFileSync(
path.join(directory, 'E/package.json'),
JSON.stringify({
bin: './script.js',
})
}),
);
fs.writeFileSync(path.join(directory, 'E/script.js'), 'foo\r\nbar');
fs.writeFileSync(path.join(directory, 'E/another-script.js'), 'baz\r\nqux');
Expand All @@ -68,7 +68,7 @@ describe('pkg-ok', () => {
'./dist/lib.cjs.js': './dist/lib.cjs.browser.js',
'./dist/lib.esm.js': './dist/lib.esm.browser.js',
},
})
}),
);
fs.writeFileSync(path.join(directory, 'F/dist/lib.cjs.browser.js'), 'cjs');
fs.writeFileSync(path.join(directory, 'F/dist/lib.esm.browser.js'), 'esm');
Expand All @@ -81,15 +81,15 @@ describe('pkg-ok', () => {
'dist/lib.cjs.js': './dist/lib.cjs.browser.js',
'./dist/lib.esm.js': 'dist/lib.esm.browser.js',
},
})
}),
);
fs.writeFileSync(path.join(directory, 'G/dist/lib.cjs.js'), './dist/lib.cjs.browser.js');
});

it('checks /A', (done) => {
execFile('node', ['dist/bin.js', path.join(directory, 'A')], (_error, stdout) => {
expect(stdout).toMatch(
/main[\s\S]*bin[\s\S]*types[\s\S]*typings[\s\S]*module[\s\S]*es2015[\s\S]*browser[\s\S]*exports/
/main[\s\S]*bin[\s\S]*types[\s\S]*typings[\s\S]*module[\s\S]*es2015[\s\S]*browser[\s\S]*exports/,
);
done();
});
Expand All @@ -109,7 +109,7 @@ describe('pkg-ok', () => {
(_error, stdout) => {
expect(stdout).toMatch(/foo/);
done();
}
},
);
});

Expand All @@ -120,7 +120,7 @@ describe('pkg-ok', () => {
(_error, stdout) => {
expect(stdout).toMatch(/foo\.bar[\s\S]*foo\.baz/);
done();
}
},
);
});

Expand All @@ -131,10 +131,10 @@ describe('pkg-ok', () => {
() => {
expect(fs.readFileSync(path.join(directory, '/E/script.js'), 'utf-8')).toEqual('foo\nbar');
expect(fs.readFileSync(path.join(directory, '/E/another-script.js'), 'utf-8')).toEqual(
'baz\nqux'
'baz\nqux',
);
done();
}
},
);
});

Expand All @@ -144,13 +144,13 @@ describe('pkg-ok', () => {
['dist/bin.js', path.join(directory, 'F'), '--bin', 'another-script.js'],
() => {
expect(
fs.readFileSync(path.join(directory, '/F/dist/lib.cjs.browser.js'), 'utf-8')
fs.readFileSync(path.join(directory, '/F/dist/lib.cjs.browser.js'), 'utf-8'),
).toEqual('cjs');
expect(
fs.readFileSync(path.join(directory, '/F/dist/lib.esm.browser.js'), 'utf-8')
fs.readFileSync(path.join(directory, '/F/dist/lib.esm.browser.js'), 'utf-8'),
).toEqual('esm');
done();
}
},
);
});

Expand All @@ -161,7 +161,7 @@ describe('pkg-ok', () => {
(_error, stdout) => {
expect(stdout).toMatch(/browser.*path[\s\S]*browser.*path[\s\S]*browser.*must/);
done();
}
},
);
});
});
2 changes: 1 addition & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const cli = meow(
isMultiple: true,
},
},
}
},
);

const errorMessage = (error: unknown) => {
Expand Down
6 changes: 3 additions & 3 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('pkg-ok', () => {

it('checks /A', () => {
expect(() => pkgOk(path.join('/A'))).toThrowError(
/main[\s\S]*bin[\s\S]*types[\s\S]*typings[\s\S]*module[\s\S]*es2015[\s\S]*browser[\s\S]*exports/
/main[\s\S]*bin[\s\S]*types[\s\S]*typings[\s\S]*module[\s\S]*es2015[\s\S]*browser[\s\S]*exports/,
);
});

Expand All @@ -73,7 +73,7 @@ describe('pkg-ok', () => {

it('checks /D', () => {
expect(() => pkgOk(path.join('/D'), { fields: ['foo'] })).toThrowError(
/foo\.bar[\s\S]*foo\.baz/
/foo\.bar[\s\S]*foo\.baz/,
);
});

Expand All @@ -91,7 +91,7 @@ describe('pkg-ok', () => {

it('checks /G', () => {
expect(() => pkgOk(path.join('/G'))).toThrowError(
/browser.*path[\s\S]*browser.*path[\s\S]*browser.*must/
/browser.*path[\s\S]*browser.*path[\s\S]*browser.*must/,
);
});
});

0 comments on commit 83662ba

Please sign in to comment.