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

Add lesson 2 with simple console calc #3

Merged
merged 5 commits into from
Apr 6, 2020
Merged

Conversation

nickovchinnikov
Copy link
Owner

No description provided.

@nickovchinnikov nickovchinnikov requested a review from vvscode April 5, 2020 21:53
@nickovchinnikov nickovchinnikov force-pushed the nick/lesson2 branch 2 times, most recently from 77a6a5d to 3b4cdc9 Compare April 6, 2020 06:58
@@ -0,0 +1,39 @@
import { firstPrioritiesCalc, secondPrioritiesCalc } from "./engine";

test("firstPrioritiesCalc: [1, * 32]", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

просто комментарий - я привык к структуре describe(blockName) / it(testCase) - вроде это чаще с jest встречается

import { isNumber } from "./helpers";
import { mathOperators } from "./mathOperators";

export type ParsedLineType = Array<number | string>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А как использовать интерфейс, если у меня скалярный тип? Можно пример?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Откровенно говоря, для меня конструкция Array<number | string> более очевидна и предпочтительная vs (number | string)[]
В целом, можно сослаться и довериться твоему опыту, попробую использовать, спасибо!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

дело вкуса, я просто дал ссылку на тот стайлгайд, который внутри команды TS используется

любой вариант валиден, если он линтер проходит ))

mathOperatorsPriorities,
} from "./mathOperators";

const { FIRST, SECOND } = mathPriorities;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в общем случае (когда может быть больше 2 приоритетов) это был бы масссив

Copy link
Collaborator

@vvscode vvscode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лично мне не хватило подробной истории (чтобы по коммитам можно было проследить ход разработки)

@nickovchinnikov
Copy link
Owner Author

@vvscode все замечания поправил и подкинул в PR! Спасибо за проверку!

test("runner: 2 * 32", () => {
expect(runner("2 * 32")).toEqual(64);
});
it("runner: 2 * 32", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case you have describe - no need to put that prefix runner: manually

when you run jest in verbose mode - it renders it as sublists

Copy link
Owner Author

@nickovchinnikov nickovchinnikov Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good catch, now everything according with the describe/it notation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants