Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "test: add test case for issue #4334" #5475

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"abbrev": "^2.0.0",
"archy": "^1.0.0",
"bluebird": "^3.7.2",
"hexo-cli": "^4.3.2",
"hexo-cli": "^4.3.0",
D-Sketon marked this conversation as resolved.
Show resolved Hide resolved
"hexo-front-matter": "^4.2.1",
"hexo-fs": "^4.1.3",
"hexo-i18n": "^2.0.0",
Expand Down Expand Up @@ -74,7 +74,6 @@
"@types/mocha": "^10.0.6",
"@types/node": "^18.11.8 <18.19.9",
"@types/nunjucks": "^3.2.2",
"@types/rewire": "^2.5.30",
"@types/sinon": "^17.0.3",
"@types/text-table": "^0.2.4",
"c8": "^9.0.0",
Expand All @@ -87,7 +86,6 @@
"husky": "^8.0.1",
"lint-staged": "^15.2.0",
"mocha": "^10.0.0",
"rewire": "^7.0.0",
"sinon": "^17.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2"
Expand Down
77 changes: 0 additions & 77 deletions test/scripts/console/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Promise from 'bluebird';
import { useFakeTimers, spy, SinonSpy } from 'sinon';
import Hexo from '../../../lib/hexo';
import newConsole from '../../../lib/plugins/console/new';
import rewire from 'rewire';
type OriginalParams = Parameters<typeof newConsole>;
type OriginalReturn = ReturnType<typeof newConsole>;

Expand Down Expand Up @@ -364,80 +363,4 @@ describe('new', () => {

await unlink(path);
});

it('path - number (issue #4334)', async () => {
let args;
const cli = rewire('hexo-cli');
return cli.__with__({
find_pkg_1: {
default: (_cwd, _args) => {
args = _args;
return Promise.resolve();
}
}
})(async () => {
process.argv = ['hexo', 'new', '--path', '123', 'test'];
// @ts-ignore
cli(null, null);
args.path.should.eql('123');
process.argv = [];
});
});

it('p - number (issue #4334)', async () => {
let args;
const cli = rewire('hexo-cli');
return cli.__with__({
find_pkg_1: {
default: (_cwd, _args) => {
args = _args;
return Promise.resolve();
}
}
})(async () => {
process.argv = ['hexo', 'new', '-p', '123', 'test'];
// @ts-ignore
cli(null, null);
args.p.should.eql('123');
process.argv = [];
});
});

it('slug - number (issue #4334)', async () => {
let args;
const cli = rewire('hexo-cli');
return cli.__with__({
find_pkg_1: {
default: (_cwd, _args) => {
args = _args;
return Promise.resolve();
}
}
})(async () => {
process.argv = ['hexo', 'new', '--slug', '123', 'test'];
// @ts-ignore
cli(null, null);
args.slug.should.eql('123');
process.argv = [];
});
});

it('s - number (issue #4334)', async () => {
let args;
const cli = rewire('hexo-cli');
return cli.__with__({
find_pkg_1: {
default: (_cwd, _args) => {
args = _args;
return Promise.resolve();
}
}
})(async () => {
process.argv = ['hexo', 'new', '-s', '123', 'test'];
// @ts-ignore
cli(null, null);
args.s.should.eql('123');
process.argv = [];
});
});
});
Loading