@jacobx1/of-sdk
Version:
Node interface for interacting with Omnifocus
47 lines • 1.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const omnijs_1 = require("../../osa/omnijs");
describe('omnijs', () => {
describe('read tests', () => {
it('gets all open tasks', async () => {
const allTasks = await omnijs_1.getTasks((item) => !item.completed);
expect(allTasks).toBeTruthy();
}, 60000);
it('get projects', async () => {
const allProjects = await omnijs_1.getProjects();
expect(allProjects).toBeTruthy();
});
it('gets tags', async () => {
const allTags = await omnijs_1.getTags();
expect(allTags).toBeTruthy();
});
it('gets tasks from perspective', async () => {
const allTasks = await omnijs_1.getTasksForPerspective('Today');
expect(allTasks).toBeTruthy();
});
});
describe('write tests', () => {
const newTaskIds = [];
it('creates a task', async () => {
const task = await omnijs_1.createTask('Hello world');
expect(task).toBeTruthy();
newTaskIds.push(task.id);
});
it('creates task in project', async () => {
const projects = await omnijs_1.getProjects((item) => item.name === 'GitHub');
const project = projects[0];
const task = await omnijs_1.createTask('Hello github', {
projectId: project.id,
note: 'WOOOO',
});
expect(task).toBeTruthy();
newTaskIds.push(task.id);
});
afterAll(async () => {
for (const id of newTaskIds) {
await omnijs_1.deleteTaskById(id);
}
});
});
});
//# sourceMappingURL=omnijs.js.map