Skip to content

Commit

Permalink
Adds trigger sample, and fixes code and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoliveira committed Sep 6, 2024
1 parent 92d702b commit 5248dc0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions samples/triggers/Sample.trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @Tests: SampleTriggerTest
trigger Sample on Sample (before insert) {
return;
}
2 changes: 1 addition & 1 deletion src/commands/apextests/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class ApextestsList extends SfCommand<ApextestsListResult> {
throw new Error('Invalid directory.');
}

const files = readDir.filter((file) => file.endsWith('.cls'));
const files = readDir.filter((file) => file.endsWith('.cls') || file.endsWith('.trigger'));
const testMethodsNames: string[] = [];

// read each file and check for the test methods at the top
Expand Down
2 changes: 1 addition & 1 deletion test/commands/apextests/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect } from 'chai';
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
import ApextestsList from '../../../src/commands/apextests/list.js';

const TEST_LIST = ['SampleTest', 'SuperSampleTest', 'Sample2Test', 'SuperSample2Test'];
const TEST_LIST = ['SampleTest', 'SuperSampleTest', 'Sample2Test', 'SuperSample2Test', 'SampleTriggerTest'];

describe('apextests list', () => {
const $$ = new TestContext();
Expand Down

0 comments on commit 5248dc0

Please sign in to comment.