• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devpow112 / serverless-plugin-function-value / 15779174711

20 Jun 2025 12:41PM CUT coverage: 100.0%. Remained the same
15779174711

push

github

devpow112
chore(deps-dev): bump mocha from 11.6.0 to 11.7.0

Bumps [mocha](https://github.com/mochajs/mocha) from 11.6.0 to 11.7.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v11.6.0...v11.7.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-version: 11.7.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

1 of 1 branches covered (100.0%)

Branch coverage included in aggregate %.

20 of 20 relevant lines covered (100.0%)

3.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/function-value-plugin.js
1
const formatLog = (resolver, address, result) =>
2✔
2
  `\${${resolver}:${address}} => ${JSON.stringify(result)}`;
3✔
3

4
export default class FunctionValuePlugin {
5
  constructor(serverless, _, { log }) {
6
    const naming = serverless.getProvider('aws').naming;
6✔
7
    const functions = serverless.service.getAllFunctions();
6✔
8
    const classes = serverless.classes;
6✔
9

10
    const getLambdaLogicalId = address => {
6✔
11
      if (functions.includes(address)) {
6✔
12
        return naming.getLambdaLogicalId(address);
3✔
13
      }
14

15
      throw new classes.Error(`Function "${address}" not defined`);
3✔
16
    };
17

18
    this.configurationVariablesSources = {
6✔
19
      'fn.arn': {
20
        resolve: ({ address }) => {
21
          const result = { 'Fn::GetAtt': [getLambdaLogicalId(address), 'Arn'] };
2✔
22

23
          log.debug(formatLog('fn.arn', address, result));
1✔
24

25
          return { value: result };
1✔
26
        }
27
      },
28
      'fn.name': {
29
        resolve: ({ address }) => {
30
          const result = { Ref: getLambdaLogicalId(address) };
2✔
31

32
          log.debug(formatLog('fn.name', address, result));
1✔
33

34
          return { value: result };
1✔
35
        }
36
      },
37
      'fn.logicalid': {
38
        resolve: ({ address }) => {
39
          const result = getLambdaLogicalId(address);
2✔
40

41
          log.debug(formatLog('fn.logicalid', address, result));
1✔
42

43
          return { value: result };
1✔
44
        }
45
      }
46
    };
47
  }
48
}
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc