How to use the alsatian.Expect function in alsatian

To help you get started, we’ve selected a few alsatian examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypeScriptToLua / TypeScriptToLua / test / integration / lua / modules.spec.ts View on Github external
public lualibRequire() {
        // Transpile
        let lua = util.transpileString(``, {dontRequireLuaLib: false, luaTarget: "JIT"});

        // Assert
        Expect(dedent(lua)).toBe(`require("typescript_lualib")`);
    }
}
github poetapp / node / test / Unit / ClaimHelper / GetClaimId.ts View on Github external
public claimIdIgnoresId(work: Work) {
    // The field .id is ignored in the calculation of the id
    const ignoreId = getClaimId({
      ...work,
      id: '123'
    })
    Expect(ignoreId).toBe(work.id)
  }
github poetapp / poet-js / test / Claim / GetClaimId.ts View on Github external
public claimIdIgnoresId(work: Work) {
    // The field .id is ignored in the calculation of the id
    const ignoreId = getClaimId({
      ...work,
      id: '123',
    })
    Expect(ignoreId).toBe(work.id)
  }
github poetapp / node / test / Integration / GetWorksByPublicKey.ts View on Github external
async getWorksByPublicKeyShouldReturnExpectedFields(publicKey: string, expectedClaims: ReadonlyArray) {
    const response = await this.client.getWorksByPublicKey(publicKey)

    Expect(response.status).toBe(200)
    Expect(response.ok).toBeTruthy()

    const claims: ReadonlyArray = await response.json()

    for (let i = 0; i < claims.length; i++) {
      Expect(claims[i].id).toBe(expectedClaims[i].id)
      Expect(claims[i].publicKey).toBe(expectedClaims[i].publicKey)
      Expect(claims[i].signature).toBe(expectedClaims[i].signature)
      Expect(claims[i].created).toBe(expectedClaims[i].created)
    }
  }
github poetapp / node / test / Unit / ClaimHelper / GetClaimId.ts View on Github external
public claimId(work: Work) {
    const claimId = getClaimId(work)
    Expect(claimId).toBe(work.id)
  }
github RocketChat / Rocket.Chat.Apps-engine / tests / server / accessors / ConfigurationModify.spec.ts View on Github external
public useConfigurationModify() {
        Expect(() => new ConfigurationModify(this.ssm, this.scm)).not.toThrow();

        const sm = new ConfigurationModify(this.ssm, this.scm);
        Expect(sm.serverSettings).toBeDefined();
        Expect(sm.slashCommands).toBeDefined();
    }
}
github djfdyuruiry / ts-lambda-api / tests / src / AuthFilterTests.ts View on Github external
public async when_api_auth_filter_configured_then_401_unauthorized_response_contains_www_authenticate_header() {
        this.app.middlewareRegistry.addAuthFilter(
            new TestAuthFilter("luke", "vaderismydad")
        )

        let response = await this.sendRequest(
            RequestBuilder.get("/test")
                .build()
        )

        Expect(response.headers["www-authenticate"]).toBeDefined()
    }
github RocketChat / Rocket.Chat.Apps-engine / tests / server / accessors / ConfigurationModify.spec.ts View on Github external
public useConfigurationModify() {
        Expect(() => new ConfigurationModify(this.ssm, this.scm)).not.toThrow();

        const sm = new ConfigurationModify(this.ssm, this.scm);
        Expect(sm.serverSettings).toBeDefined();
        Expect(sm.slashCommands).toBeDefined();
    }
}
github RocketChat / Rocket.Chat.Apps-engine / tests / server / accessors / ConfigurationExtend.spec.ts View on Github external
public useConfigurationExtend() {
        Expect(() => new ConfigurationExtend(this.he, this.se, this.sce, this.api)).not.toThrow();

        const se = new ConfigurationExtend(this.he, this.se, this.sce, this.api);
        Expect(se.http).toBeDefined();
        Expect(se.settings).toBeDefined();
        Expect(se.slashCommands).toBeDefined();
    }
}
github nodulusteam / methodus.dev / tests / mock.spec.ts View on Github external
public async mockTestController() {
        Mocker.mock(TestController);
        const mockResult = await TestController.list('', '');
        Expect(mockResult).toBeDefined();
    }

alsatian

TypeScript and JavaScript testing framework for beautiful and readable tests

MIT
Latest version published 4 years ago

Package Health Score

47 / 100
Full package analysis