From 1bb233a7f0c59fc30303bd9eb9f362bc4d1c5e92 Mon Sep 17 00:00:00 2001 From: curbengh <43627182+curbengh@users.noreply.github.com> Date: Mon, 16 Dec 2019 11:59:56 +0000 Subject: [PATCH 1/3] test: comment out missing tests --- test/scripts/console/deploy.js | 2 +- test/scripts/console/render.js | 2 ++ test/scripts/hexo/hexo.js | 4 ++-- test/scripts/hexo/load_database.js | 12 ++++++------ test/scripts/models/category.js | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/scripts/console/deploy.js b/test/scripts/console/deploy.js index 8b0d9bd4a7..0c6cab9e13 100644 --- a/test/scripts/console/deploy.js +++ b/test/scripts/console/deploy.js @@ -77,7 +77,7 @@ describe('deploy', () => { }); }); - it('deployer not found'); + // it('deployer not found'); it('generate', () => fs.writeFile(pathFn.join(hexo.source_dir, 'test.txt'), 'test').then(() => deploy({generate: true})).then(() => fs.readFile(pathFn.join(hexo.public_dir, 'test.txt'))).then(content => { content.should.eql('test'); diff --git a/test/scripts/console/render.js b/test/scripts/console/render.js index a336319d7f..2ac5dababb 100644 --- a/test/scripts/console/render.js +++ b/test/scripts/console/render.js @@ -76,6 +76,8 @@ describe('render', () => { }); }); + // it('output'); + it('engine', () => { const src = pathFn.join(hexo.base_dir, 'test'); const dest = pathFn.join(hexo.base_dir, 'result.json'); diff --git a/test/scripts/hexo/hexo.js b/test/scripts/hexo/hexo.js index ea95481f78..c396354199 100644 --- a/test/scripts/hexo/hexo.js +++ b/test/scripts/hexo/hexo.js @@ -138,7 +138,7 @@ describe('Hexo', () => { }); }); - it('model()'); + // it('model()'); it('_showDrafts()', () => { hexo._showDrafts().should.be.false; @@ -188,7 +188,7 @@ describe('Hexo', () => { it('watch() - theme', () => testWatch(pathFn.join(hexo.theme_dir, 'source'))); - it('unwatch()'); + // it('unwatch()'); it('exit()', () => { const hook = sinon.spy(); diff --git a/test/scripts/hexo/load_database.js b/test/scripts/hexo/load_database.js index 770e30fe35..0fa358be29 100644 --- a/test/scripts/hexo/load_database.js +++ b/test/scripts/hexo/load_database.js @@ -52,10 +52,10 @@ describe('Load database', () => { // I don't know why this test case can't pass on Windows // It always throws EPERM error - it.skip('database load failed', () => fs.writeFile(dbPath, '{1423432: 324').then(() => loadDatabase(hexo)).then(() => { - hexo._dbLoaded.should.be.false; - return fs.exists(dbPath); - }).then(exist => { - exist.should.be.false; - })); + // it('database load failed', () => fs.writeFile(dbPath, '{1423432: 324').then(() => loadDatabase(hexo)).then(() => { + // hexo._dbLoaded.should.be.false; + // return fs.exists(dbPath); + // }).then(exist => { + // exist.should.be.false; + // })); }); diff --git a/test/scripts/models/category.js b/test/scripts/models/category.js index 19cef2b197..16df7f0df4 100644 --- a/test/scripts/models/category.js +++ b/test/scripts/models/category.js @@ -23,7 +23,7 @@ describe('Category', () => { }); }); - it.skip('parent - reference'); + // it('parent - reference'); it('slug - virtual', () => Category.insert({ name: 'foo' From f5a7b1f6eca84852c5c2f4b9f76c7280acabcd45 Mon Sep 17 00:00:00 2001 From: curbengh <43627182+curbengh@users.noreply.github.com> Date: Mon, 16 Dec 2019 12:02:32 +0000 Subject: [PATCH 2/3] test(list_archives): add timezone --- test/scripts/helpers/list_archives.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/scripts/helpers/list_archives.js b/test/scripts/helpers/list_archives.js index d9c8990b9e..6c94f71fc1 100644 --- a/test/scripts/helpers/list_archives.js +++ b/test/scripts/helpers/list_archives.js @@ -178,5 +178,20 @@ describe('list_archives', () => { ].join('')); }); - it('timezone'); + it('timezone', () => { + ctx.config.timezone = 'Asia/Tokyo'; + const result = listArchives({ + format: 'YYYY MM ZZ' + }); + + result.should.eql([ + '' + ].join('')); + + ctx.config.timezone = ''; + }); }); From caf41c4ac48ab17e68d014279376c6794370ec09 Mon Sep 17 00:00:00 2001 From: curbengh <43627182+curbengh@users.noreply.github.com> Date: Tue, 17 Dec 2019 01:07:20 +0000 Subject: [PATCH 3/3] test: mention missing-unit-test --- test/scripts/console/deploy.js | 2 +- test/scripts/console/render.js | 2 +- test/scripts/hexo/hexo.js | 4 ++-- test/scripts/models/category.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/scripts/console/deploy.js b/test/scripts/console/deploy.js index 0c6cab9e13..9582342d7a 100644 --- a/test/scripts/console/deploy.js +++ b/test/scripts/console/deploy.js @@ -77,7 +77,7 @@ describe('deploy', () => { }); }); - // it('deployer not found'); + // it('deployer not found'); missing-unit-test it('generate', () => fs.writeFile(pathFn.join(hexo.source_dir, 'test.txt'), 'test').then(() => deploy({generate: true})).then(() => fs.readFile(pathFn.join(hexo.public_dir, 'test.txt'))).then(content => { content.should.eql('test'); diff --git a/test/scripts/console/render.js b/test/scripts/console/render.js index 2ac5dababb..0d1ede1476 100644 --- a/test/scripts/console/render.js +++ b/test/scripts/console/render.js @@ -76,7 +76,7 @@ describe('render', () => { }); }); - // it('output'); + // it('output'); missing-unit-test it('engine', () => { const src = pathFn.join(hexo.base_dir, 'test'); diff --git a/test/scripts/hexo/hexo.js b/test/scripts/hexo/hexo.js index c396354199..0c525b18b0 100644 --- a/test/scripts/hexo/hexo.js +++ b/test/scripts/hexo/hexo.js @@ -138,7 +138,7 @@ describe('Hexo', () => { }); }); - // it('model()'); + // it('model()'); missing-unit-test it('_showDrafts()', () => { hexo._showDrafts().should.be.false; @@ -188,7 +188,7 @@ describe('Hexo', () => { it('watch() - theme', () => testWatch(pathFn.join(hexo.theme_dir, 'source'))); - // it('unwatch()'); + // it('unwatch()'); missing-unit-test it('exit()', () => { const hook = sinon.spy(); diff --git a/test/scripts/models/category.js b/test/scripts/models/category.js index 16df7f0df4..1283a02884 100644 --- a/test/scripts/models/category.js +++ b/test/scripts/models/category.js @@ -23,7 +23,7 @@ describe('Category', () => { }); }); - // it('parent - reference'); + // it('parent - reference'); missing-unit-test it('slug - virtual', () => Category.insert({ name: 'foo'