<commit_before><commit_msg>Add addFilterToQuery tests for password field<commit_after>var demand = require('must');
var PasswordType = require('../PasswordType');

exports.initList = function (List) {
	List.add({
		password: <PASSWORD>,
	});
};

exports.testFieldType = function (List) {
	describe('addFilterToQuery', function () {
		it('should filter for existing values', function () {
			var result = List.fields.password.addFilterToQuery({
				exists: true,
			});
			demand(result.password).eql({
				$ne: null,
			});
		});

		it('should filter for non-existing values', function () {
			var result = List.fields.password.addFilterToQuery({
				exists: false,
			});
			demand(result.password).eql(null);
		});
	});
};
{'fraction_non_alphanumeric': 0.16160220994475138, 'fraction_numerical': 0.0, 'mean_word_length': 4.253623188405797, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3811374', 'n_tokens_mistral': 254, 'n_tokens_neox': 220, 'n_words': 48}