Skip to content

Commit

Permalink
build(all): 修改脚本分支合并方式
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherso1a committed Oct 22, 2019
1 parent f4f7f0b commit 062d3cc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { shuffle } from '../src/array/shuffle';
import { shuffle } from '../../src/array/shuffle';

test('shuffle [1,2,3,4] will returns a array with length 4', () => {
expect(shuffle([1, 2, 3, 4]).length).toBe(4);
Expand Down
20 changes: 20 additions & 0 deletions __tests__/function/trodeb.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { throttle } from '../../src/function/throttle';
// import { debounce} from "../../src/function/debounce";

test('throttle', () => {
let count: Number = 0;
let fn = n => n++;
let throttled = throttle(fn, 20);
for (let i = 0; i < 5; i++) {
setTimeout(() => {
throttled(count);
expect(count).toBe(i + 1);
}, i * 21);
}
for (let i = 0; i < 2; i++) {
setTimeout(() => {
throttled(count);
expect(count).toBe(1);
}, i * 9);
}
});
5 changes: 5 additions & 0 deletions __tests__/object/object2map.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { object2map } from '../../src/object/object2map';

test('object2map {a:1,b:2} will returns a Map', () => {
expect(object2map({ a: 1, b: 2 }).size).toBe(2);
});
11 changes: 11 additions & 0 deletions __tests__/string/parseurl.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { parseQuery } from '../../src/string/parseQuery';
import { stringifyQuery } from '../../src/string/stringifyQuery';

test('parseQuery "a=1&b=2" returns an object', () => {
expect(JSON.stringify(parseQuery('a=1&b=2'))).toBe(
JSON.stringify({ a: '1', b: '2' })
);
});
test('stringifyQuery "{a:1,b:2}" returns an string', () => {
expect(stringifyQuery({ a: 1, b: 2 })).toBe('a=1&b=2');
});
2 changes: 1 addition & 1 deletion scripts/feature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ $1 == 'm' ];then
git push
git checkout $2
git pull --rebase
git merge feature/$FEATURE --no-ff -m "Merge branch feature/$FEATURE"
git rebase feature/$FEATURE
git push
else
echo '存在尚未提交的更改,请检查git status,已终止合并' #退出合并脚本
Expand Down

0 comments on commit 062d3cc

Please sign in to comment.