Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfdctaka committed May 6, 2024
1 parent 67e3236 commit e56c20d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/lib/rules/apex/import-apex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2024, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/

'use strict';

const { RuleTester } = require('eslint');
const { RULE_TESTER_CONFIG } = require('../shared');

const allRules = require('../../../../lib/index');
const runtTester = new RuleTester(RULE_TESTER_CONFIG);

runtTester.run('@salesforce/lwc-mobile/import-apex', allRules.rules['import-apex'], {
valid: [
{
code: "import getContactList from '@salesforce/apex/ContactController.getContactList';"
}
],
// 'invalid' checks cases that should not pass
invalid: [
{
code: "import getContactList from '@salesforce/apex/ContactController.getContactList';",
output: "import getContactList from '@salesforce/apex/ContactController.getContactList';",
errors: 1
}
]
});

0 comments on commit e56c20d

Please sign in to comment.