Skip to content

Commit

Permalink
Merge pull request #1977 from demergent-labs/is_controller_property_t…
Browse files Browse the repository at this point in the history
…ests

Is controller property tests
  • Loading branch information
lastmjs authored Aug 7, 2024
2 parents 6c70333 + f119716 commit d376118
Show file tree
Hide file tree
Showing 13 changed files with 6,547 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ jobs:
"tests/end_to_end/http_server/web_assembly",
"tests/property/ic_api/caller",
"tests/property/ic_api/id",
"tests/property/ic_api/is_controller",
"tests/property/ic_api/time",
"tests/property/ic_api/trap"
]
Expand Down
4 changes: 4 additions & 0 deletions dfx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ export function whoami(): string {
return execSync(`dfx identity whoami`).toString().trim();
}

export function whoamiPrincipal(): string {
return execSync(`dfx identity get-principal`).toString().trim();
}

type StorageMode = 'keyring' | 'password-protected' | 'plaintext';

export function generateIdentity(name: string): Buffer {
Expand Down
1 change: 1 addition & 0 deletions tests/property/ic_api/caller/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"strict": true,
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "node",
"allowJs": true,
"outDir": "HACK_BECAUSE_OF_ALLOW_JS"
Expand Down
4 changes: 4 additions & 0 deletions tests/property/ic_api/is_controller/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.azle
.dfx
dfx_generated
node_modules
13 changes: 13 additions & 0 deletions tests/property/ic_api/is_controller/dfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"canisters": {
"canister": {
"type": "azle",
"main": "src/index.ts",
"candid_gen": "automatic",
"declarations": {
"output": "test/dfx_generated/canister",
"node_compatibility": true
}
}
}
}
12 changes: 12 additions & 0 deletions tests/property/ic_api/is_controller/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
bail: true,
testTimeout: 100_000_000,
transform: {
'^.+\\.ts$': ['ts-jest', { isolatedModules: true }],
'^.+\\.js$': 'ts-jest'
},
transformIgnorePatterns: ['/node_modules/(?!(azle)/)'] // Make sure azle is transformed
};
Loading

0 comments on commit d376118

Please sign in to comment.