mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* chore: bundle babel-cli and babel-node * chore: bundle babel-helper-builder-react-jsx * refactor: unify extra entrypoints handling * chore: bundle babel-helper-transform-fixture-test-runner * chore: bundle babel-helper-fixtures * build: bundle babel-helpers * build: bundle babel-build-external-helpers * refactor: reuse pkgJSON in PackageInfo * refactor: skip inputs path normalization * build: bundle babel-eslint-parser * fixup babel-helpers * revert babel-cli bin changes * update npm-ignore generators * cleanup outdated comments * test(eslint): avoid private sub imports * chore: bundle babel-eslint-* * chore: bundle babel-register * chore: skip rollup for private packages
24 lines
677 B
JavaScript
24 lines
677 B
JavaScript
import { chmod } from "../lib/babel/util.js";
|
|
|
|
describe("util.js", () => {
|
|
describe("chmod", () => {
|
|
it("should warn the user if chmod fails", () => {
|
|
const spyConsoleWarn = jest
|
|
.spyOn(console, "warn")
|
|
.mockImplementation(() => {});
|
|
|
|
// The first argument should be a string.
|
|
// The real reason chmod will fail is due to wrong permissions,
|
|
// but this is enough to cause a failure.
|
|
chmod(100, "file.js");
|
|
|
|
expect(spyConsoleWarn).toHaveBeenCalledTimes(1);
|
|
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
|
"Cannot change permissions of file.js",
|
|
);
|
|
|
|
spyConsoleWarn.mockRestore();
|
|
});
|
|
});
|
|
});
|