Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ updates:
applies-to: version-updates
patterns:
- "@aws-sdk/*"
chai:
applies-to: version-updates
patterns:
- "chai*"
eslint:
applies-to: version-updates
patterns:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"scripts": {
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"test": "node tests/runner.js"
"test": "mocha 'tests/**/*-test.mjs'"
},
"dependencies": {
"@aws-sdk/client-cloudfront": "^3.855.0",
Expand All @@ -27,8 +27,8 @@
"uuid": "^11.0.1"
},
"devDependencies": {
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai": "^6.2.2",
"chai-as-promised": "^8.0.2",
"eslint": "^8.0.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-node": "^11.1.0",
Expand Down
81 changes: 18 additions & 63 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions tests/helpers/assert.js

This file was deleted.

8 changes: 8 additions & 0 deletions tests/helpers/assert.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-env node */

import { use, assert } from 'chai';
import chaiAsPromised from 'chai-as-promised';

use(chaiAsPromised);

export default assert;
6 changes: 3 additions & 3 deletions tests/index-test.js → tests/index-test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-env node */
/* eslint-disable no-undef */
var assert = require('./helpers/assert');
var plugin = require('../index');
var BasePlugin = require('ember-cli-deploy-plugin');
import assert from './helpers/assert.mjs';
import plugin from '../index.js';
import BasePlugin from 'ember-cli-deploy-plugin';

describe('ember-cli-dpeloy-cloudfront plugin', function () {
var pluginInstance, invalidateAssertions;
Expand Down
23 changes: 11 additions & 12 deletions tests/lib/cloudfront-test.js → tests/lib/cloudfront-test.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* eslint-env node */
/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */
var assert = require('../helpers/assert');
var RSVP = require('rsvp');
import assert from '../helpers/assert.mjs';
import RSVP from 'rsvp';
import LibCloudFront from '../../lib/cloudfront.js';
import { CloudFront as AWSCloudFront } from '@aws-sdk/client-cloudfront';

describe('cloudfront', function () {
var CloudFront, validParams, validOptions, cloudfrontClient, plugin, subject;
var validParams, validOptions, validResponse, cloudfrontClient, plugin, subject;

before(function () {
process.env['AWS_ACCESS_KEY_ID'] = 'set_via_env_var';
process.env['AWS_SECRET_ACCESS_KEY'] = 'set_via_env_var';

CloudFront = require('../../lib/cloudfront');
});

beforeEach(function () {
Expand All @@ -33,7 +33,7 @@ describe('cloudfront', function () {
},
log: function noop() {},
};
subject = new CloudFront({
subject = new LibCloudFront({
plugin: plugin,
});
validOptions = {
Expand All @@ -52,12 +52,11 @@ describe('cloudfront', function () {
context('using the aws-sdk CloudFront client', function () {
beforeEach(function () {
plugin.readConfig = function (propertyName) {};
subject = new CloudFront({ plugin: plugin });
subject = new LibCloudFront({ plugin: plugin });
});

it('uses the AWS client', function () {
var { CloudFront } = require('@aws-sdk/client-cloudfront');
assert.ok(subject._client instanceof CloudFront);
assert.ok(subject._client instanceof AWSCloudFront);
});

context('with credentials in plugin config', function () {
Expand All @@ -70,7 +69,7 @@ describe('cloudfront', function () {
return 'set_via_config';
}
};
subject = new CloudFront({ plugin: plugin });
subject = new LibCloudFront({ plugin: plugin });
});

it('uses the configured credentials', function () {
Expand All @@ -85,7 +84,7 @@ describe('cloudfront', function () {
context('with no credentials in the plugin config', function () {
beforeEach(function () {
plugin.readConfig = function (propertyName) {};
subject = new CloudFront({ plugin: plugin });
subject = new LibCloudFront({ plugin: plugin });
});

it('falls back to default AWS credential resolution', function () {
Expand Down Expand Up @@ -145,7 +144,7 @@ describe('cloudfront', function () {

describe('waiting for invalidation', function () {
beforeEach(function () {
subject = new CloudFront({
subject = new LibCloudFront({
plugin: plugin,
});
validOptions.waitForInvalidation = true;
Expand Down
28 changes: 0 additions & 28 deletions tests/runner.js

This file was deleted.

Loading