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

Convert src/ to TypeScript #68

Merged
merged 25 commits into from Feb 18, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+48 −41
Diff settings

Always

Just for now

All unit tests should be run with build results.

  • Loading branch information...
saneyuki committed Feb 16, 2017
commit 721d9fec6066fdc4b091b851f962c1d3ef60ace9
View
@@ -31,7 +31,8 @@
"lint:docs": "textlint -f pretty-error docs/",
"test:example": "nf start --procfile test/Procfile",
"test:perf": "cd perf/node-memory-leak-testing && npm install && npm test",
"test:js": "mocha",
"test:js": "run-s build test:mocha",
"test:mocha": "env NODE_ENV=development mocha",
"test:saucelabs": "zuul -- test/*-test.js",
"test:browser": "zuul --local 8080 --ui mocha-bdd -- test/*-test.js",
"test": "run-s --print-label test:js lint:docs test:example && run-s test:perf",
View
@@ -1,16 +1,16 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import Context from "../src/Context";
import Dispatcher from "../src/Dispatcher";
import Store from "../src/Store";
import UseCase from "../src/UseCase";
import UseCaseExecutor from "../src/UseCaseExecutor";
import StoreGroup from "../src/UILayer/StoreGroup";
import Context from "../lib/Context";
import Dispatcher from "../lib/Dispatcher";
import Store from "../lib/Store";
import UseCase from "../lib/UseCase";
import UseCaseExecutor from "../lib/UseCaseExecutor";
import StoreGroup from "../lib/UILayer/StoreGroup";
import createEchoStore from "./helper/EchoStore";
// payload
import {Payload, WillExecutedPayload, DidExecutedPayload, CompletedPayload, ErrorPayload} from "../src/index";
import {Payload, WillExecutedPayload, DidExecutedPayload, CompletedPayload, ErrorPayload} from "../lib/index";
class TestUseCase extends UseCase {
execute() {
View
@@ -1,7 +1,9 @@
// LICENSE : MIT
"use strict";
const assert = require("assert");
import Dispatcher from "../src/Dispatcher";
import Dispatcher from "../lib/Dispatcher";
describe("Dispatcher", function() {
describe("#onDispatch", function() {
it("should return un-listen function", function() {
@@ -1,9 +1,9 @@
// MIT © 2017 azu
"use strict";
const assert = require("assert");
import Context from "../src/Context";
import Dispatcher from "../src/Dispatcher";
import Store from "../src/Store";
import Context from "../lib/Context";
import Dispatcher from "../lib/Dispatcher";
import Store from "../lib/Store";
import NoDispatchUseCase from "./use-case/NoDispatchUseCase";
import DispatchUseCase from "./use-case/DispatchUseCase";
import ErrorUseCase from "./use-case/ErrorUseCase";
@@ -1,12 +1,12 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import Store from "../src/Store";
import QueuedStoreGroup from "../src/UILayer/QueuedStoreGroup";
import Store from "../lib/Store";
import QueuedStoreGroup from "../lib/UILayer/QueuedStoreGroup";
import createEchoStore from "./helper/EchoStore";
import UseCase from "../src/UseCase";
import Context from "../src/Context";
import Dispatcher from "../src/Dispatcher";
import UseCase from "../lib/UseCase";
import Context from "../lib/Context";
import Dispatcher from "../lib/Dispatcher";
const createAsyncChangeStoreUseCase = (store) => {
class ChangeTheStoreUseCase extends UseCase {
execute() {
View
@@ -1,11 +1,13 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import Context from "../src/Context";
import Dispatcher from "../src/Dispatcher";
import Store from "../src/Store";
import UseCase from "../src/UseCase";
import ErrorPayload from "../src/payload/ErrorPayload";
import Context from "../lib/Context";
import Dispatcher from "../lib/Dispatcher";
import Store from "../lib/Store";
import UseCase from "../lib/UseCase";
import ErrorPayload from "../lib/payload/ErrorPayload";
describe("Store", function() {
describe("#onDispatch", function() {
it("should called when dispatched", function(done) {
View
@@ -1,8 +1,8 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import Store from "../src/Store";
import StoreGroup from "../src/UILayer/StoreGroup";
import Store from "../lib/Store";
import StoreGroup from "../lib/UILayer/StoreGroup";
import createEchoStore from "./helper/EchoStore";
describe("StoreGroup", function() {
@@ -1,9 +1,9 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import Store from "../src/Store";
import StoreGroup from "../src/UILayer/StoreGroup";
import StoreGroupValidator from "../src/UILayer/StoreGroupValidator";
import Store from "../lib/Store";
import StoreGroup from "../lib/UILayer/StoreGroup";
import StoreGroupValidator from "../lib/UILayer/StoreGroupValidator";
import createEchoStore from "./helper/EchoStore";
describe("StoreGroupValidator", function() {
describe("validateInstance", function() {
View
@@ -1,12 +1,14 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import UseCase from "../src/UseCase";
import Dispatcher from "../src/Dispatcher";
import Store from "../src/Store";
import Context from "../src/Context";
import {WillExecutedPayload, DidExecutedPayload, CompletedPayload} from "../src/index";
import UseCaseContext from "../src/UseCaseContext";
import UseCase from "../lib/UseCase";
import Dispatcher from "../lib/Dispatcher";
import Store from "../lib/Store";
import Context from "../lib/Context";
import {WillExecutedPayload, DidExecutedPayload, CompletedPayload} from "../lib/index";
import UseCaseContext from "../lib/UseCaseContext";
describe("UseCase", function() {
describe("id", () => {
it("should have unique id in instance", () => {
@@ -1,9 +1,9 @@
// LICENSE : MIT
"use strict";
const assert = require("power-assert");
import UseCaseExecutor from "../src/UseCaseExecutor";
import UseCase from "../src/UseCase";
import Dispatcher from "../src/Dispatcher";
import UseCaseExecutor from "../lib/UseCaseExecutor";
import UseCase from "../lib/UseCase";
import Dispatcher from "../lib/Dispatcher";
describe("UseCaseExecutor", function() {
context("when UseCase is successful completion", function() {
it("dispatch will -> did", function() {
View
@@ -1,6 +1,6 @@
// LICENSE : MIT
"use strict";
import Store from "../../src/Store";
import Store from "../../lib/Store";
export default function createEchoStore({
name,
echo
@@ -1,6 +1,6 @@
// MIT © 2017 azu
"use strict";
import UseCase from "../../src/UseCase";
import UseCase from "../../lib/UseCase";
export default class DispatchUseCase extends UseCase {
/**
* @param {Payload} payload
@@ -1,6 +1,6 @@
// LICENSE : MIT
"use strict";
import UseCase from "../../src/UseCase";
import UseCase from "../../lib/UseCase";
export default class ErrorUseCase extends UseCase {
execute() {
return Promise.reject(new Error("error"));
@@ -1,6 +1,6 @@
// LICENSE : MIT
"use strict";
import UseCase from "../../src/UseCase";
import UseCase from "../../lib/UseCase";
// Parent -> ChildUseCase
export class ParentUseCase extends UseCase {
constructor() {
@@ -1,6 +1,6 @@
// MIT © 2017 azu
"use strict";
import UseCase from "../../src/UseCase";
import UseCase from "../../lib/UseCase";
export default class NoDispatchUseCase extends UseCase {
execute() {
}
ProTip! Use n and p to navigate between commits in a pull request.