forked from fanruan/fineui
Compare commits
107 Commits
research/t
...
master
Author | SHA1 | Date |
---|---|---|
|
cdec6f784f | 8 months ago |
|
039ec622c4 | 8 months ago |
|
d5ee4e67f9 | 8 months ago |
|
04a58a4a0b | 8 months ago |
|
26b2e1332f | 8 months ago |
|
77477f1bfd | 8 months ago |
|
cbdc63081f | 8 months ago |
|
41609ada7e | 8 months ago |
|
37fbf06103 | 8 months ago |
|
e100e4115e | 8 months ago |
|
ebbd7e6056 | 8 months ago |
|
3063da4874 | 8 months ago |
|
736980cb6e | 8 months ago |
|
bcedb54782 | 8 months ago |
|
bbd0315030 | 8 months ago |
|
2109dee89d | 8 months ago |
|
c8d04fabdb | 8 months ago |
|
d421c97306 | 8 months ago |
|
b6ad497984 | 8 months ago |
|
a6b9042a49 | 8 months ago |
|
6a17673c96 | 8 months ago |
|
45172096df | 8 months ago |
|
1c7689361d | 9 months ago |
|
572d216e64 | 9 months ago |
|
aaf988b6fe | 9 months ago |
|
aed35bbce6 | 9 months ago |
|
f9b75be7ea | 9 months ago |
|
eacdf59bed | 9 months ago |
|
91c81250fc | 9 months ago |
|
bb260ec29a | 9 months ago |
|
e4aafdc056 | 9 months ago |
|
9189327b54 | 9 months ago |
|
02361b2675 | 9 months ago |
|
1909ba3ef7 | 9 months ago |
|
8a57bcb479 | 9 months ago |
|
7bcfbc79d2 | 9 months ago |
|
304126a7f1 | 9 months ago |
|
fba8461b98 | 9 months ago |
|
8f41724169 | 9 months ago |
|
9ab289d8c3 | 9 months ago |
|
117d7fb659 | 9 months ago |
|
a26102950d | 9 months ago |
|
4e63a7ef55 | 9 months ago |
|
b74eba39f0 | 9 months ago |
|
e1593bc0fc | 9 months ago |
|
a33d9862b0 | 9 months ago |
|
2d7d80e719 | 9 months ago |
|
535f7128fe | 9 months ago |
|
fbe18a5138 | 9 months ago |
|
c22c5d43dd | 9 months ago |
|
7b407d4aa1 | 9 months ago |
|
1b4e6e43b1 | 9 months ago |
|
70e2f876da | 9 months ago |
|
d3ab2af3fd | 9 months ago |
|
067435dd1e | 9 months ago |
|
f00e4c5b6c | 9 months ago |
|
5bff3e170e | 9 months ago |
|
59a4e56d5f | 9 months ago |
|
9bb7c12459 | 9 months ago |
|
05f6c41996 | 9 months ago |
|
7fc5c63af9 | 9 months ago |
|
fba1af3f9b | 9 months ago |
|
12899d2e88 | 9 months ago |
|
3fe3b3d8e9 | 9 months ago |
|
3b060f11a2 | 9 months ago |
|
3f55e7a72b | 9 months ago |
|
a01610e2ab | 9 months ago |
|
e8f7a6c60b | 10 months ago |
|
74ccf2f8cc | 10 months ago |
|
f752b70990 | 10 months ago |
|
7beaeccebb | 10 months ago |
|
8dbbbd5e2c | 10 months ago |
|
2f199552b9 | 10 months ago |
|
212e8315f4 | 10 months ago |
|
b87665d7be | 10 months ago |
|
6378314e1b | 10 months ago |
|
877e71adfc | 10 months ago |
|
4a69f2f440 | 10 months ago |
|
e712b52428 | 10 months ago |
|
f0e91077bb | 10 months ago |
|
00a60c6a63 | 10 months ago |
|
083ad18c21 | 10 months ago |
|
3e44318c7e | 10 months ago |
|
8d4b0a67cc | 10 months ago |
|
36083aca64 | 10 months ago |
|
ca3659e5e3 | 10 months ago |
|
ecbc12af1b | 10 months ago |
|
6c0c17ac8b | 10 months ago |
|
de3dd7a48a | 10 months ago |
|
d19aa45390 | 11 months ago |
|
d03dff4c64 | 11 months ago |
|
9a244ce9cb | 11 months ago |
|
201d665d25 | 11 months ago |
|
5a7d85e730 | 11 months ago |
|
4e2d22a017 | 11 months ago |
|
930ebedede | 11 months ago |
|
7cb4f23775 | 11 months ago |
|
e8fa741855 | 11 months ago |
|
198d1fcb6f | 11 months ago |
|
7c95e8c1fb | 11 months ago |
|
9288b7bd0d | 11 months ago |
|
fdb47604f7 | 11 months ago |
|
af7e395d4a | 11 months ago |
|
42deeb4a67 | 11 months ago |
|
0537e0c4e9 | 11 months ago |
|
f4a5e2e574 | 11 months ago |
|
c87867cf2e | 11 months ago |
123 changed files with 1331 additions and 1495 deletions
@ -1,2 +1,2 @@ |
|||||||
PUPPETEER_DOWNLOAD_BASE_URL=https://cdn.npmmirror.com/binaries/chrome-for-testing |
puppeteer_download_host=https://npm.taobao.org/mirrors |
||||||
@fui:registry=https://npm.fineres.com/ |
@fui:registry=https://npm.fineres.com/ |
Binary file not shown.
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,51 +0,0 @@ |
|||||||
import type { Config } from "jest"; |
|
||||||
// import webpackConfig from "./webpack/webpack.dev";
|
|
||||||
|
|
||||||
export default { |
|
||||||
// testEnvironment: "<rootDir>/test/testEnvironmentJsdom.ts",
|
|
||||||
testEnvironment: "jsdom", |
|
||||||
testEnvironmentOptions: { |
|
||||||
// html: fs.readFileSync(path.join(__dirname, "test/index.html")),
|
|
||||||
}, |
|
||||||
testMatch: ["<rootDir>/src/**/*.test.js"], |
|
||||||
collectCoverage: false, |
|
||||||
collectCoverageFrom: ["src/**/*.js", "!src/**/*.test.js"], |
|
||||||
coverageDirectory: "coverage", |
|
||||||
coverageReporters: ["html", "json-summary", "cobertura"], |
|
||||||
|
|
||||||
reporters: [ |
|
||||||
"default", |
|
||||||
[ |
|
||||||
"jest-html-reporters", |
|
||||||
{ |
|
||||||
publicPath: "./html-report", |
|
||||||
openReport: true, |
|
||||||
}, |
|
||||||
], |
|
||||||
], |
|
||||||
|
|
||||||
transform: { |
|
||||||
"^.+\\.jsx?$": "babel-jest", |
|
||||||
"^.+\\.tsx?$": "babel-jest", |
|
||||||
}, |
|
||||||
|
|
||||||
preset: "jest-puppeteer", |
|
||||||
verbose: true, |
|
||||||
watchman: true, |
|
||||||
injectGlobals: true, |
|
||||||
globals: { |
|
||||||
"ts-jest": { |
|
||||||
tsconfig: "tsconfig.json", |
|
||||||
}, |
|
||||||
}, |
|
||||||
setupFilesAfterEnv: [ |
|
||||||
"<rootDir>/src/bundle.js", |
|
||||||
"<rootDir>/src/core/platform/web/config.js", |
|
||||||
"<rootDir>/../demo/i18n/i18n.cn.js", |
|
||||||
"<rootDir>/test/utils.js", |
|
||||||
"<rootDir>/test/prepare.js", |
|
||||||
], |
|
||||||
moduleNameMapper: { |
|
||||||
"@/(.*)$": "<rootDir>/src/$1", |
|
||||||
}, |
|
||||||
} as Config; |
|
@ -1,167 +0,0 @@ |
|||||||
// Karma configuration
|
|
||||||
// Generated on Mon Nov 27 2017 11:16:26 GMT+0800 (中国标准时间)
|
|
||||||
|
|
||||||
const os = require("os"); |
|
||||||
const webpackConfig = require("./webpack/webpack.dev") |
|
||||||
|
|
||||||
process.env.CHROME_BIN = require("puppeteer").executablePath(); |
|
||||||
|
|
||||||
module.exports = function (config) { |
|
||||||
config.set({ |
|
||||||
|
|
||||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
||||||
basePath: "", |
|
||||||
|
|
||||||
|
|
||||||
// frameworks to use
|
|
||||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
||||||
frameworks: ["webpack", "mocha", "chai"], |
|
||||||
|
|
||||||
|
|
||||||
// list of files / patterns to load in the browser
|
|
||||||
files: [].concat( |
|
||||||
webpackConfig.entry.fineui, |
|
||||||
["test/**/*.js", "src/**/*.test.js"] |
|
||||||
), |
|
||||||
|
|
||||||
exclude: [ |
|
||||||
"src/base/tree/ztree/jquery.ztree.core-3.5.js", |
|
||||||
"src/base/tree/ztree/jquery.ztree.excheck-3.5.js", |
|
||||||
"src/base/single/input/file.js", |
|
||||||
"src/case/loading/loading_pane.js", |
|
||||||
"src/base/tree/ztree/**/*.js", |
|
||||||
"src/case/tree/ztree/*.js", |
|
||||||
"src/widget/multitree/**/*.js", |
|
||||||
"src/widget/multiselecttree/**/*.js", |
|
||||||
"src/component/treevaluechooser/*.js" |
|
||||||
], |
|
||||||
|
|
||||||
|
|
||||||
// preprocess matching files before serving them to the browser
|
|
||||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
||||||
preprocessors: { |
|
||||||
"src/less/**/*.less": ["webpack"], |
|
||||||
"ui/**/*.less": ["webpack"], |
|
||||||
"src/*.js": ["webpack"], |
|
||||||
"src/**/!(*.test).js": ["webpack"], |
|
||||||
}, |
|
||||||
|
|
||||||
|
|
||||||
// test results reporter to use
|
|
||||||
// possible values: 'dots', 'progress'
|
|
||||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
||||||
reporters: ["progress", "coverage", "html"], |
|
||||||
|
|
||||||
browserDisconnectTolerance: 3, |
|
||||||
browserDisconnectTimeout : 300000, |
|
||||||
browserNoActivityTimeout : 300000, |
|
||||||
|
|
||||||
coverageReporter: { |
|
||||||
// specify a common output directory
|
|
||||||
dir: "coverage/", |
|
||||||
reporters: [ |
|
||||||
// reporters not supporting the `file` property
|
|
||||||
{ type: "html", subdir: "report-html" }, |
|
||||||
{ type: "json-summary", subdir: "report-json-summary" }, |
|
||||||
{ type: "cobertura", subdir: "report-cobertura"} |
|
||||||
] |
|
||||||
}, |
|
||||||
|
|
||||||
htmlReporter: { |
|
||||||
outputFile: "logs/test-report.html" |
|
||||||
}, |
|
||||||
|
|
||||||
|
|
||||||
// web server port
|
|
||||||
port: 9878, |
|
||||||
|
|
||||||
|
|
||||||
// enable / disable colors in the output (reporters and logs)
|
|
||||||
colors: true, |
|
||||||
|
|
||||||
|
|
||||||
// level of logging
|
|
||||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
||||||
logLevel: config.LOG_INFO, |
|
||||||
|
|
||||||
loggers: [ |
|
||||||
{ |
|
||||||
type: "console" |
|
||||||
}, |
|
||||||
{ |
|
||||||
type: "file", |
|
||||||
filename: "logs/karma.log" |
|
||||||
} |
|
||||||
], |
|
||||||
|
|
||||||
|
|
||||||
// enable / disable watching file and executing tests whenever any file changes
|
|
||||||
autoWatch: true, |
|
||||||
|
|
||||||
// you can define custom flags
|
|
||||||
customLaunchers: { |
|
||||||
HeadlessChrome: { |
|
||||||
base: "ChromeHeadless", |
|
||||||
flags: [ |
|
||||||
"--no-sandbox", |
|
||||||
"--remote-debugging-port=9222", |
|
||||||
"--enable-logging", |
|
||||||
"--user-data-dir=./karma-chrome", |
|
||||||
"--v=1", |
|
||||||
"--disable-background-timer-throttling", |
|
||||||
"--disable-renderer-backgrounding", |
|
||||||
"--proxy-bypass-list=*", |
|
||||||
"--disable-web-security", |
|
||||||
"--disable-gpu", |
|
||||||
], |
|
||||||
}, |
|
||||||
ChromeDebug: { |
|
||||||
base: "Chrome", |
|
||||||
flags: [ |
|
||||||
"--no-sandbox", |
|
||||||
"--remote-debugging-port=9222", |
|
||||||
"--enable-logging", |
|
||||||
"--user-data-dir=./karma-chrome", |
|
||||||
"--v=1", |
|
||||||
"--disable-background-timer-throttling", |
|
||||||
"--disable-renderer-backgrounding", |
|
||||||
"--proxy-bypass-list=*", |
|
||||||
"--disable-web-security", |
|
||||||
"--disable-gpu", |
|
||||||
], |
|
||||||
}, |
|
||||||
}, |
|
||||||
|
|
||||||
// // start these browsers
|
|
||||||
// // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
|
||||||
browsers: [os.platform() === "win32" |
|
||||||
&& parseFloat(os.release() |
|
||||||
.split(".") |
|
||||||
.slice(0, 2) |
|
||||||
.join(".")) <= 6.1 |
|
||||||
? "HeadlessChrome" : "ChromeHeadless"], |
|
||||||
|
|
||||||
retryLimit: 30, |
|
||||||
|
|
||||||
captureTimeout: 30000, |
|
||||||
|
|
||||||
// Continuous Integration mode
|
|
||||||
// if true, Karma captures browsers, runs the tests and exits
|
|
||||||
singleRun: true, |
|
||||||
|
|
||||||
// Concurrency level
|
|
||||||
// how many browser should be started simultaneous
|
|
||||||
concurrency: Infinity, |
|
||||||
|
|
||||||
webpack: webpackConfig, |
|
||||||
|
|
||||||
plugins: [ |
|
||||||
"karma-webpack", |
|
||||||
"karma-mocha", |
|
||||||
"karma-chai", |
|
||||||
"karma-chrome-launcher", |
|
||||||
"karma-coverage", |
|
||||||
"karma-htmlfile-reporter", |
|
||||||
] |
|
||||||
}); |
|
||||||
}; |
|
@ -1,31 +1,31 @@ |
|||||||
/** |
/** |
||||||
* Created by windy on 2018/01/23. |
* Created by windy on 2018/01/23. |
||||||
*/ |
*/ |
||||||
describe("dateFunctionTest", () => { |
describe("dateFunctionTest", function () { |
||||||
|
|
||||||
beforeAll(() => { |
before(function () { |
||||||
|
|
||||||
}); |
}); |
||||||
|
|
||||||
/** |
/** |
||||||
* test_author_windy |
* test_author_windy |
||||||
*/ |
*/ |
||||||
it("getWeekNumber", () => { |
it("getWeekNumber", function () { |
||||||
expect(BI.print(BI.getDate(2005, 0, 1), "%Y-%W")).toBe("2004-53"); |
expect(BI.print(BI.getDate(2005, 0, 1), "%Y-%W")).to.equal("2004-53"); |
||||||
expect(BI.print(BI.getDate(2005, 0, 2), "%Y-%W")).toBe("2004-53"); |
expect(BI.print(BI.getDate(2005, 0, 2), "%Y-%W")).to.equal("2004-53"); |
||||||
expect(BI.print(BI.getDate(2005, 11, 31), "%Y-%W")).toBe("2005-52"); |
expect(BI.print(BI.getDate(2005, 11, 31), "%Y-%W")).to.equal("2005-52"); |
||||||
expect(BI.print(BI.getDate(2007, 0, 1), "%Y-%W")).toBe("2007-01"); |
expect(BI.print(BI.getDate(2007, 0, 1), "%Y-%W")).to.equal("2007-01"); |
||||||
expect(BI.print(BI.getDate(2007, 11, 30), "%Y-%W")).toBe("2007-52"); |
expect(BI.print(BI.getDate(2007, 11, 30), "%Y-%W")).to.equal("2007-52"); |
||||||
expect(BI.print(BI.getDate(2007, 11, 31), "%Y-%W")).toBe("2008-01"); |
expect(BI.print(BI.getDate(2007, 11, 31), "%Y-%W")).to.equal("2008-01"); |
||||||
expect(BI.print(BI.getDate(2008, 0, 1), "%Y-%W")).toBe("2008-01"); |
expect(BI.print(BI.getDate(2008, 0, 1), "%Y-%W")).to.equal("2008-01"); |
||||||
expect(BI.print(BI.getDate(2008, 11, 28), "%Y-%W")).toBe("2008-52"); |
expect(BI.print(BI.getDate(2008, 11, 28), "%Y-%W")).to.equal("2008-52"); |
||||||
expect(BI.print(BI.getDate(2008, 11, 29), "%Y-%W")).toBe("2009-01"); |
expect(BI.print(BI.getDate(2008, 11, 29), "%Y-%W")).to.equal("2009-01"); |
||||||
expect(BI.print(BI.getDate(2008, 11, 30), "%Y-%W")).toBe("2009-01"); |
expect(BI.print(BI.getDate(2008, 11, 30), "%Y-%W")).to.equal("2009-01"); |
||||||
expect(BI.print(BI.getDate(2008, 11, 31), "%Y-%W")).toBe("2009-01"); |
expect(BI.print(BI.getDate(2008, 11, 31), "%Y-%W")).to.equal("2009-01"); |
||||||
expect(BI.print(BI.getDate(2009, 0, 1), "%Y-%W")).toBe("2009-01"); |
expect(BI.print(BI.getDate(2009, 0, 1), "%Y-%W")).to.equal("2009-01"); |
||||||
expect(BI.print(BI.getDate(2009, 11, 31), "%Y-%W")).toBe("2009-53"); |
expect(BI.print(BI.getDate(2009, 11, 31), "%Y-%W")).to.equal("2009-53"); |
||||||
expect(BI.print(BI.getDate(2010, 0, 1), "%Y-%W")).toBe("2009-53"); |
expect(BI.print(BI.getDate(2010, 0, 1), "%Y-%W")).to.equal("2009-53"); |
||||||
expect(BI.print(BI.getDate(2010, 0, 2), "%Y-%W")).toBe("2009-53"); |
expect(BI.print(BI.getDate(2010, 0, 2), "%Y-%W")).to.equal("2009-53"); |
||||||
expect(BI.print(BI.getDate(2010, 0, 3), "%Y-%W")).toBe("2009-53"); |
expect(BI.print(BI.getDate(2010, 0, 3), "%Y-%W")).to.equal("2009-53"); |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue