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
9 changes: 5 additions & 4 deletions common/config/rush/pnpm-lock.yaml

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

34 changes: 17 additions & 17 deletions sdk/tables/data-tables/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const {
jsonRecordingFilterFunction,
isPlaybackMode,
isSoftRecordMode,
isRecordMode
isRecordMode,
} = require("@azure-tools/test-recorder");

module.exports = function(config) {
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",
Expand All @@ -29,7 +29,7 @@ module.exports = function(config) {
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-json-preprocessor",
"karma-json-to-file-reporter"
"karma-json-to-file-reporter",
],

// list of files / patterns to load in the browser
Expand All @@ -39,8 +39,8 @@ module.exports = function(config) {
pattern: `pattern: "dist-test/index.browser.js.map`,
type: "html",
included: false,
served: true
}
served: true,
},
].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []),

// list of files / patterns to exclude
Expand All @@ -50,7 +50,7 @@ module.exports = function(config) {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"recordings/browsers/**/*.json": ["json"]
"recordings/browsers/**/*.json": ["json"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// [`dist-test/${testMode}.index.browser.js`]: ["coverage"]
Expand All @@ -69,7 +69,7 @@ module.exports = function(config) {
"ACCOUNT_CONNECTION_STRING",
"AZURE_TENANT_ID",
"AZURE_CLIENT_ID",
"AZURE_CLIENT_SECRET"
"AZURE_CLIENT_SECRET",
],

// test results reporter to use
Expand All @@ -84,8 +84,8 @@ module.exports = function(config) {
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
]
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
],
},

junitReporter: {
Expand All @@ -95,12 +95,12 @@ module.exports = function(config) {
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
properties: {}, // key value pair of properties to add to the <properties> section of the report
},

jsonToFileReporter: {
filter: jsonRecordingFilterFunction,
outputPath: "."
outputPath: ".",
},

// web server port
Expand All @@ -125,8 +125,8 @@ module.exports = function(config) {
base: "ChromeHeadless",
//--no-sandbox allows our tests to run in Linux without having to change the system.
// --disable-web-security allows us to authenticate from the browser without setting up special CORS configuration
flags: ["--no-sandbox", "--disable-web-security"]
}
flags: ["--no-sandbox", "--disable-web-security"],
},
},

// Continuous Integration mode
Expand All @@ -141,16 +141,16 @@ module.exports = function(config) {
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
terminal: !isRecordMode()
terminal: !isRecordMode(),
},

client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000"
}
timeout: "600000",
},
},
args: config.testMode ? ["--testMode"] : []
args: config.testMode ? ["--testMode"] : [],
});
};
2 changes: 1 addition & 1 deletion sdk/tables/data-tables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^7.1.1",
"mocha-junit-reporter": "^2.0.0",
"prettier": "^1.16.4",
"prettier": "^2.5.1",
"nyc": "^15.0.0",
"rimraf": "^3.0.0",
"rollup": "^1.16.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import {
TableServiceClient,
AzureNamedKeyCredential,
AzureSASCredential
AzureSASCredential,
} from "@azure/data-tables";

import { DefaultAzureCredential } from "@azure/identity";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function createSimpleDateEntity() {
const entity = {
partitionKey: "p1",
rowKey: "r1",
date: new Date()
date: new Date(),
};

await client.createEntity(entity);
Expand All @@ -55,7 +55,7 @@ async function createComplexDateEntity() {
const entity = {
partitionKey: "p2",
rowKey: "r2",
date
date,
};

await client.createEntity(entity);
Expand All @@ -81,7 +81,7 @@ async function createAndDeleteEntities() {
rowKey: "A1",
name: "Marker Set",
price: 5.0,
quantity: 21
quantity: 21,
};

// Create the new entity
Expand Down
12 changes: 6 additions & 6 deletions sdk/tables/data-tables/samples-dev/generateTableSAS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
TableClient,
TableServiceClient,
AccountSasPermissions,
TableSasPermissions
TableSasPermissions,
} from "@azure/data-tables";
import { AzureNamedKeyCredential, AzureSASCredential } from "@azure/core-auth";

Expand Down Expand Up @@ -45,14 +45,14 @@ async function generateTableSasSample() {
// Grants permission to query entities
query: true,
// Grants permission to delete tables and entities
delete: true
delete: true,
};

// Generate an account SAS with the NamedKeyCredential and the permissions set previously
// by default, expiration is set an hour after the SAS is created. Expiration can be
// set explicitly by passing expiresOn with the desired expiration Date
const accountSas = generateAccountSas(cred, {
permissions
permissions,
});

const tableService = new TableServiceClient(tablesUrl, new AzureSASCredential(accountSas));
Expand All @@ -77,13 +77,13 @@ async function generateTableSasSample() {
// Allows deleting entities
delete: true,
// Allows updating entities
update: true
update: true,
};

// Create the table SAS token
const tableSas = generateTableSas(tableName, cred, {
expiresOn: new Date("2021-12-12"),
permissions: tablePermissions
permissions: tablePermissions,
});

// Create a new client for the table we just created. Alternatively the Table Account SAS token could be used here as well
Expand All @@ -94,7 +94,7 @@ async function generateTableSasSample() {
await table.createEntity({
partitionKey: "test",
rowKey: "1",
foo: "bar"
foo: "bar",
});

// List all the entities in the table
Expand Down
12 changes: 6 additions & 6 deletions sdk/tables/data-tables/samples-dev/queryEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ async function listEntities() {
rowKey: "1",
name: "Markers",
price: 5.0,
quantity: 34
quantity: 34,
};

const planner: Entity = {
partitionKey,
rowKey: "2",
name: "Planner",
price: 7.0,
quantity: 34
quantity: 34,
};

// create entities for marker and planner
Expand All @@ -51,7 +51,7 @@ async function listEntities() {

// List all entities with PartitionKey "Stationery"
const listResults = client.listEntities<Entity>({
queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` }
queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` },
});

for await (const product of listResults) {
Expand All @@ -60,7 +60,7 @@ async function listEntities() {

// List all entities with a price less than 6.0
const priceListResults = client.listEntities({
queryOptions: { filter: odata`price le 6` }
queryOptions: { filter: odata`price le 6` },
});

console.log("-- Products with a price less or equals to 6.00");
Expand All @@ -84,8 +84,8 @@ async function listTopNEntities() {
// List all entities with PartitionKey "Stationery"
const listResults = client.listEntities<Entity>({
queryOptions: {
filter: odata`PartitionKey eq ${partitionKey}`
}
filter: odata`PartitionKey eq ${partitionKey}`,
},
});

let topEntities = [];
Expand Down
2 changes: 1 addition & 1 deletion sdk/tables/data-tables/samples-dev/queryTables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function queryTables() {
// odata is a helper function that takes care of encoding the query
// filter, in this sample it will add quotes around tableName
const queryTableResults = serviceClient.listTables({
queryOptions: { filter: odata`TableName eq ${tableName}` }
queryOptions: { filter: odata`TableName eq ${tableName}` },
});

// Iterate the results
Expand Down
18 changes: 9 additions & 9 deletions sdk/tables/data-tables/samples-dev/transactionOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async function batchOperations() {
rowKey: "A1",
name: "Marker Set",
price: 5.0,
quantity: 21
}
quantity: 21,
},
],
[
"create",
Expand All @@ -46,8 +46,8 @@ async function batchOperations() {
rowKey: "A2",
name: "Pen Set",
price: 2.0,
quantity: 6
}
quantity: 6,
},
],
[
"create",
Expand All @@ -56,9 +56,9 @@ async function batchOperations() {
rowKey: "A3",
name: "Pencil",
price: 1.5,
quantity: 100
}
]
quantity: 100,
},
],
];

// Submit the transaction with the list of actions.
Expand Down Expand Up @@ -95,8 +95,8 @@ async function batchOperations() {
[
"update",
{ partitionKey, rowKey: "A2", name: "[Updated - Replace] Pen Set", price: 99, quantity: 33 },
"Replace"
]
"Replace",
],
];

const updateResult = await client.submitTransaction(updateTransaction);
Expand Down
6 changes: 3 additions & 3 deletions sdk/tables/data-tables/samples-dev/transactionWithHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ async function batchOperations() {
rowKey: "A1",
name: "Marker Set",
price: 5.0,
quantity: 21
quantity: 21,
});
transaction.createEntity({
partitionKey,
rowKey: "A2",
name: "Pen Set",
price: 2.0,
quantity: 6
quantity: 6,
});
transaction.createEntity({
partitionKey,
rowKey: "A3",
name: "Pencil",
price: 1.5,
quantity: 100
quantity: 100,
});

// Submit the transaction using the actions list built by the helper
Expand Down
Loading