Created
April 17, 2019 17:14
-
-
Save allain/762ee11f2217152d687e99feba6e36aa to your computer and use it in GitHub Desktop.
Amazing things with pikapkg and tree shaking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AgentRepo from './AgentRepo' | |
class AgentMemoryRepo extends AgentRepo { | |
load() { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AgentRepo, {contract} from './AgentRepo' | |
import AgentMemoryRepo from './AgentMemoryRepo' | |
describe('AgentMemoryRepo', () => { | |
contract(() => new AgentMemoryRepo()) | |
it('can be created', () => expect(new AgentMemoryRepo()).toBeInstanceOf(AgentMemoryRepo)) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class AgentRepo {} | |
export function contract(builder) { | |
it('can be created', () => expect(builder()).toBeInstanceOf(AgentRepo)) | |
it('exposes load method', () => { | |
const a = builder() | |
expect(a.load).toBeInstanceOf(Function) | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AgentMemoryRepo from './AgentMemoryRepo.js' | |
const r = new AgentMemoryRepo() | |
console.log(r.load(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment